本文整理汇总了PHP中Checkout::sendEmails方法的典型用法代码示例。如果您正苦于以下问题:PHP Checkout::sendEmails方法的具体用法?PHP Checkout::sendEmails怎么用?PHP Checkout::sendEmails使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Checkout
的用法示例。
在下文中一共展示了Checkout::sendEmails方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeCheckoutProcess
/**
* Perform the final steps needed to finish an AIM web order
*
* @return array|bool
* @throws Exception
*/
public function executeCheckoutProcess()
{
$objCart = Yii::app()->shoppingcart;
if ($objCart->payment_id === null) {
throw new Exception('Cart must have an associated payment.');
}
self::executeCheckoutProcessInit();
// save ids that we need for after finalization
$cartlink = $objCart->linkid;
$id = $objCart->id;
// run payment and finalize order
if ($this->runPayment($objCart->payment_id) === false) {
return false;
}
// send emails
Checkout::sendEmails($id);
// awesome.
return array('success' => true, 'cartlink' => $cartlink);
}
示例2: FinalizeCheckout
/**
*
* TODO: Remove this function and incorporate the one in the Checkout Component instead.
* Also verify if the ecp variable is still necessary
*
* Final steps in completing cart and recalculating inventory numbers.
*
* @param null ShoppingCart $objCart
*
* @param bool $performInternalFinalizeSteps
* if true, it's either an IPN-like transaction, an AIM payment, or a
* an alternative payment method (ex. cash on delivery). So we can
* handle the final steps within Web Store. If false, it's a SIM credit
* card transaction and we ignore those steps which will allow for
* the calling action to echo an html meta refresh which redirects the
* customer to Web Store's receipt page. We have to do this since some
* processors try to render the receipt page on their own domain and
* we don't want that since the necessary CSS won't be available.
*
* @param bool $ecp
* If ecp (executeCheckoutProcess, a function from the Checkout controller)
* is true, do not redirect to receipt.
*
* @return void
*/
public static function FinalizeCheckout($objCart = null, $performInternalFinalizeSteps = true, $ecp = false)
{
Yii::log("Finalizing checkout", 'info', 'application.' . __CLASS__ . "." . __FUNCTION__);
if (!$objCart) {
$objCart = Yii::app()->shoppingcart;
}
unset(Yii::app()->session['checkout.cache']);
self::PreFinalizeHooks($objCart);
//Send receipt e-mails in the queue
Checkout::sendEmails($objCart->id);
// Mark as successful order, ready to download.
Yii::log("Marking as " . OrderStatus::AwaitingProcessing, 'info', 'application.' . __CLASS__ . "." . __FUNCTION__);
$objCart->cart_type = CartType::order;
$objCart->status = OrderStatus::AwaitingProcessing;
$objCart->UpdateWishList();
//if we are supposed to delete anything
$objCart->save();
// Cart items get updated too.
foreach ($objCart->cartItems as $item) {
$item->cart_type = CartType::order;
$item->save();
}
$objCart->RecalculateInventoryOnCartItems();
$strLinkId = $objCart->linkid;
$objCart->payment->markCompleted();
self::PostFinalizeHooks($objCart);
if ($performInternalFinalizeSteps === true) {
//If we're behind a common SSL and we want to stay logged in
if (Yii::app()->isCommonSSL && $objCart->customer->record_type != Customer::GUEST) {
Yii::app()->user->setState('sharedssl', 1);
}
//If we were in as guest, immediately log out of guest account
if ($objCart->customer->record_type == Customer::GUEST && Yii::app()->theme->info->advancedCheckout === false) {
Yii::app()->user->logout();
}
//Redirect to our receipt, we're done
Yii::app()->shoppingcart->releaseCart();
Yii::log("Redirecting to receipt, thank you for coming, exit through the gift shop.", 'info', 'application.' . __CLASS__ . "." . __FUNCTION__);
if (!$ecp) {
self::redirectToReceipt($strLinkId);
}
}
}