当前位置: 首页>>代码示例>>PHP>>正文


PHP Checkout::sendEmails方法代码示例

本文整理汇总了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);
 }
开发者ID:uiDeveloper116,项目名称:webstore,代码行数:25,代码来源:CheckoutController.php

示例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);
         }
     }
 }
开发者ID:uiDeveloper116,项目名称:webstore,代码行数:68,代码来源:CartController.php


注:本文中的Checkout::sendEmails方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。