/** * {@inheritdoc} */ public function save(\Magento\Quote\Api\Data\CartInterface $quote) { if ($quote->getId()) { $currentQuote = $this->get($quote->getId(), [$quote->getStoreId()]); $currentQuote->setStoreId($quote->getStoreId()); // This part has to be refactored if ($quote->getBillingAddress()) { $currentQuote->setBillingAddress($quote->getBillingAddress()); } $currentQuote->addData($quote->getData()); $quote = $currentQuote; } $this->getSaveHandler()->save($quote); unset($this->quotesById[$quote->getId()]); unset($this->quotesByCustomerId[$quote->getCustomerId()]); }