本文整理匯總了PHP中OrderDetail::getAll方法的典型用法代碼示例。如果您正苦於以下問題:PHP OrderDetail::getAll方法的具體用法?PHP OrderDetail::getAll怎麽用?PHP OrderDetail::getAll使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OrderDetail
的用法示例。
在下文中一共展示了OrderDetail::getAll方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: sendEmailOrderComplete
public function sendEmailOrderComplete($orderId)
{
//Instead of passing the order as a parameter, we have to pass the order ID and fetch the order again from the database
//Becase the order creation time will be null otherwise
$order = new Order($orderId);
$this->smarty->assign('order', $order);
$orderItems = OrderDetail::getAll($order->getId());
$this->smarty->assign('orderItems', $orderItems);
$body = $this->smarty->fetch("EmailOrderComplete.tpl");
$subject = "Order confirmation";
$adminEmail = SiteConfig::get("EComm::AdminEmail");
$userEmail = $order->getUserEmail();
$headers = "From: {$adminEmail}";
$mailResult1 = mail($adminEmail, $subject, $body, $headers);
$mailResult2 = mail($userEmail, $subject, $body, $headers);
return $mailResult1 && $mailResult2;
}