本文整理汇总了PHP中Magento\Quote\Model\Quote::setMayEditShippingMethod方法的典型用法代码示例。如果您正苦于以下问题:PHP Quote::setMayEditShippingMethod方法的具体用法?PHP Quote::setMayEditShippingMethod怎么用?PHP Quote::setMayEditShippingMethod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Quote\Model\Quote
的用法示例。
在下文中一共展示了Quote::setMayEditShippingMethod方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateQuote
/**
* Update quote data
*
* @param Quote $quote
* @param array $details
* @return void
*/
private function updateQuote(Quote $quote, array $details)
{
$quote->setMayEditShippingAddress(false);
$quote->setMayEditShippingMethod(true);
$this->updateQuoteAddress($quote, $details);
$this->disabledQuoteAddressValidation($quote);
$quote->collectTotals();
$this->quoteRepository->save($quote);
}
示例2: prepareOrderReview
/**
* Check whether order review has enough data to initialize
*
* @param string|null $token
* @return void
* @throws \Magento\Framework\Exception\LocalizedException
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function prepareOrderReview($token = null)
{
$payment = $this->_quote->getPayment();
if (!$payment || !$payment->getAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_PAYER_ID)) {
throw new \Magento\Framework\Exception\LocalizedException(__('A payer is not identified.'));
}
$this->_quote->setMayEditShippingAddress(1 != $this->_quote->getPayment()->getAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_SHIPPING_OVERRIDDEN));
$this->_quote->setMayEditShippingMethod('' == $this->_quote->getPayment()->getAdditionalInformation(self::PAYMENT_INFO_TRANSPORT_SHIPPING_METHOD));
$this->ignoreAddressValidation();
$this->_quote->collectTotals();
$this->quoteRepository->save($this->_quote);
}