/** * 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); }
/** * 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); }