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


PHP Mage_Sales_Model_Quote::assignCustomer方法代码示例

本文整理汇总了PHP中Mage_Sales_Model_Quote::assignCustomer方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Quote::assignCustomer方法的具体用法?PHP Mage_Sales_Model_Quote::assignCustomer怎么用?PHP Mage_Sales_Model_Quote::assignCustomer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Sales_Model_Quote的用法示例。


在下文中一共展示了Mage_Sales_Model_Quote::assignCustomer方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: initializeCustomer

 private function initializeCustomer()
 {
     if ($this->proxyOrder->isCheckoutMethodGuest()) {
         $this->quote->setCustomerId(null)->setCustomerEmail($this->proxyOrder->getBuyerEmail())->setCustomerFirstname($this->proxyOrder->getCustomerFirstName())->setCustomerLastname($this->proxyOrder->getCustomerLastName())->setCustomerIsGuest(true)->setCustomerGroupId(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID);
     }
     $this->quote->assignCustomer($this->proxyOrder->getCustomer());
 }
开发者ID:newedge-media,项目名称:iwantmymeds,代码行数:7,代码来源:Quote.php

示例2: initCheckout

 /**
  * Prepare quote, reserve order ID for specified quote
  *
  * @return string
  */
 public function initCheckout()
 {
     $this->_quote->reserveOrderId()->save();
     /**
      * Reset multishipping flag before any manipulations with quote address
      * addAddress method for quote object related on this flag
      */
     if ($this->_quote->getIsMultiShipping()) {
         $this->_quote->setIsMultiShipping(false);
         $this->_quote->save();
     }
     /*
      * want to load the correct customer information by assigning to address
      * instead of just loading from sales/quote_address
      */
     $customer = Mage::getSingleton('Mage_Customer_Model_Session')->getCustomer();
     if ($customer) {
         $this->_quote->assignCustomer($customer);
     }
     $quote = Mage::getSingleton('Mage_Checkout_Model_Session')->getQuote();
     if (!Mage::getSingleton('Mage_Customer_Model_Session')->isLoggedIn() && Mage::helper('Mage_Checkout_Helper_Data')->isAllowedGuestCheckout($quote)) {
         $this->_prepareGuestQuote();
     }
     return $this->_quote->getReservedOrderId();
 }
开发者ID:natxetee,项目名称:magento2,代码行数:30,代码来源:Checkout.php

示例3: getCustomerCart

 /**
  * Retrieve customer cart quote object model
  *
  * @return Mage_Sales_Model_Quote
  */
 public function getCustomerCart()
 {
     if (!is_null($this->_cart)) {
         return $this->_cart;
     }
     $this->_cart = Mage::getModel('sales/quote');
     if ($this->getSession()->getCustomer()->getId()) {
         $this->_cart->setStore($this->getSession()->getStore())->loadByCustomer($this->getSession()->getCustomer()->getId());
         if (!$this->_cart->getId()) {
             $this->_cart->assignCustomer($this->getSession()->getCustomer());
             $this->_cart->save();
         }
     }
     return $this->_cart;
 }
开发者ID:beejhuff,项目名称:magento-1.13.0.2,代码行数:20,代码来源:Create.php

示例4: _assignCustomer

 /**
  * @param  $customerInfo
  *   [customer] => Array
  *       (
  *           [bindId] => 1 (int)
  *           [website] => 1 (int)
  *           [group] => 1 (int)
  *           [newsletter] => 0|1
  *       )
  *
  * @param  $checkoutMode
  * @param  $billingAddress
  * @param  $needNotifyCustomer
  * @return Ess_M2ePro_Model_MagentoSales
  */
 protected function _assignCustomer($customerInfo, $checkoutMode, $billingAddress, $needNotifyCustomer)
 {
     $customer = Mage::getModel('customer/customer');
     switch ($checkoutMode) {
         default:
         case Ess_M2ePro_Model_Accounts::ORDERS_CUSTOMER_MODE_GUEST:
             $this->_quote->setCustomerId(null)->setCustomerEmail($billingAddress['email'])->setCustomerIsGuest(true)->setCustomerGroupId(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID);
             return $this;
         case Ess_M2ePro_Model_Accounts::ORDERS_CUSTOMER_MODE_NEW:
             // Register each customer
             // If we have customer with selected email - assign customer to quote
             $customer->setWebsiteId($customerInfo['website']);
             // Try to use storeId for customer
             $customer->loadByEmail($billingAddress['email']);
             if ($customer->getId()) {
                 // Customer this such email already exist
                 // If this customer need confirmation, manual activate
                 if ($customer->getConfirmation() && $customer->isConfirmationRequired()) {
                     $customer->setConfirmation(null);
                     $customer->save();
                 }
             } else {
                 // We need to create customer and register it
                 $customer = $this->_createCustomer($billingAddress, $customerInfo['website'], $customerInfo['group'], $needNotifyCustomer, $customerInfo['newsletter']);
             }
             break;
         case Ess_M2ePro_Model_Accounts::ORDERS_CUSTOMER_MODE_EXIST:
             if (!$customerInfo['bindId']) {
                 throw new LogicException('The customer ID was not specified in eBay account settings for Predefined customer mode. ');
             }
             // Assign all checkout to single account
             // Load account
             $customer = Mage::getModel('customer/customer')->load($customerInfo['bindId']);
             break;
     }
     if (!$customer->getId()) {
         // Not found - Customer
         throw new LogicException('Cannot find customer for order. It is not existed or was deleted.');
     }
     $this->_quote->assignCustomer($customer);
 }
开发者ID:par-orillonsoft,项目名称:app,代码行数:56,代码来源:Order.php

示例5: setCustomer

 /**
  * Setter for customer
  *
  * @param Mage_Customer_Model_Customer $customer
  *
  * @return Mage_Paypal_Model_Express_Checkout
  */
 public function setCustomer($customer)
 {
     $this->_quote->assignCustomer($customer);
     $this->_customerId = $customer->getId();
     return $this;
 }
开发者ID:adderall,项目名称:magento-retail-order-management,代码行数:13,代码来源:Checkout.php


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