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


PHP QuoteRepository::delete方法代码示例

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


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

示例1: testDelete

 public function testDelete()
 {
     $this->quoteMock->expects($this->once())->method('delete');
     $this->quoteMock->expects($this->exactly(1))->method('getId')->willReturn(1);
     $this->quoteMock->expects($this->exactly(1))->method('getCustomerId')->willReturn(2);
     $this->model->delete($this->quoteMock);
 }
开发者ID:ViniciusAugusto,项目名称:magento2,代码行数:7,代码来源:QuoteRepositoryTest.php

示例2: loadCustomerQuote

 /**
  * Load data for customer quote and merge with current quote
  *
  * @return $this
  */
 public function loadCustomerQuote()
 {
     if (!$this->_customerSession->getCustomerId()) {
         return $this;
     }
     $this->_eventManager->dispatch('load_customer_quote_before', ['checkout_session' => $this]);
     try {
         $customerQuote = $this->quoteRepository->getForCustomer($this->_customerSession->getCustomerId());
     } catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
         $customerQuote = $this->quoteRepository->create();
     }
     $customerQuote->setStoreId($this->_storeManager->getStore()->getId());
     if ($customerQuote->getId() && $this->getQuoteId() != $customerQuote->getId()) {
         if ($this->getQuoteId()) {
             $this->quoteRepository->save($customerQuote->merge($this->getQuote())->collectTotals());
         }
         $this->setQuoteId($customerQuote->getId());
         if ($this->_quote) {
             $this->quoteRepository->delete($this->_quote);
         }
         $this->_quote = $customerQuote;
     } else {
         $this->getQuote()->getBillingAddress();
         $this->getQuote()->getShippingAddress();
         $this->getQuote()->setCustomer($this->_customerSession->getCustomerDataObject())->setTotalsCollectedFlag(false)->collectTotals();
         $this->quoteRepository->save($this->getQuote());
     }
     return $this;
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:34,代码来源:Session.php

示例3: delete

 /**
  * {@inheritdoc}
  */
 public function delete(\Magento\Quote\Api\Data\CartInterface $quote)
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'delete');
     if (!$pluginInfo) {
         return parent::delete($quote);
     } else {
         return $this->___callPlugins('delete', func_get_args(), $pluginInfo);
     }
 }
开发者ID:HaonanXu,项目名称:der-snack-backup,代码行数:12,代码来源:Interceptor.php


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