本文整理汇总了PHP中Mage_Sales_Model_Quote::setCustomerId方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Quote::setCustomerId方法的具体用法?PHP Mage_Sales_Model_Quote::setCustomerId怎么用?PHP Mage_Sales_Model_Quote::setCustomerId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Quote
的用法示例。
在下文中一共展示了Mage_Sales_Model_Quote::setCustomerId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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());
}
示例2: _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);
}
示例3: _prepareGuestQuote
/**
* Prepare quote for guest checkout order submit
*
* @param Mage_Sales_Model_Quote $quote
* @return Mage_Checkout_Model_Api_Resource_Customer
*/
protected function _prepareGuestQuote(Mage_Sales_Model_Quote $quote)
{
$quote->setCustomerId(null)->setCustomerEmail($quote->getBillingAddress()->getEmail())->setCustomerIsGuest(true)->setCustomerGroupId(Mage_Customer_Model_Group::NOT_LOGGED_IN_ID);
return $this;
}