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


PHP Quote::setCustomerId方法代码示例

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


在下文中一共展示了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(\Magento\Customer\Model\Group::NOT_LOGGED_IN_ID);
     }
     $this->quote->assignCustomer($this->proxyOrder->getCustomer());
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:7,代码来源:Quote.php

示例2: testSaveShippingWithCustomerId

 /**
  * @magentoAppIsolation enabled
  * @magentoDbIsolation enabled
  * @magentoDataFixture Magento/Customer/_files/customer.php
  * @magentoDataFixture Magento/Customer/_files/customer_address.php
  */
 public function testSaveShippingWithCustomerId()
 {
     $this->_currentQuote->setCustomerId(1)->save();
     $data = ['address_id' => '', 'firstname' => 'Joe', 'lastname' => 'Black', 'company' => 'Lunatis', 'street' => ['1100 Parmer', 'ln.'], 'city' => 'Austin', 'region_id' => '57', 'region' => '', 'postcode' => '78757', 'country_id' => 'US', 'telephone' => '(512) 999-9999', 'fax' => '', 'save_in_address_book' => 1];
     $this->_model->saveShipping($data, 1);
     $address = $this->_currentQuote->getShippingAddress();
     /* Verify that data from Customer Address identified by id=1 is set */
     $this->assertEquals('John', $address->getFirstname());
     $this->assertEquals('Smith', $address->getLastname());
     $this->assertEquals(['Green str, 67'], $address->getStreet());
     $this->assertEquals('CityM', $address->getCity());
     $this->assertEquals('Alabama', $address->getRegion());
     $this->assertEquals(1, $address->getRegionId());
     $this->assertEquals('75477', $address->getPostcode());
     $this->assertEquals('US', $address->getCountryId());
     $this->assertEquals('3468676', $address->getTelephone());
     $this->assertEquals('customer@example.com', $address->getEmail());
     $this->assertTrue($address->getCollectShippingRates());
     $this->assertEquals(1, $address->getCustomerAddressId());
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:26,代码来源:OnepageTest.php

示例3: prepareGuestQuote

 /**
  * Prepare quote for guest checkout order submit
  *
  * @param Quote $quote
  * @return void
  */
 private function prepareGuestQuote(Quote $quote)
 {
     $quote->setCustomerId(null)->setCustomerEmail($quote->getBillingAddress()->getEmail())->setCustomerIsGuest(true)->setCustomerGroupId(Group::NOT_LOGGED_IN_ID);
 }
开发者ID:BlackIkeEagle,项目名称:magento2-continuousphp,代码行数:10,代码来源:OrderPlace.php


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