本文整理汇总了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;
}