2

Try to catch the quote items, it's working fine. But when quote is not in default website, the request is empty. How to change website ID or store ID in quote request? Did try with:

  $quote->setStore()
  $quote->setStoreId()

But no luck. This is the code:

  $orderId = 123;
  $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
  $quoteToOrder = $objectManager->create('Magento\Quote\Model\Quote\Item\ToOrderItem');
  $order = $objectManager->create('Magento\Sales\Model\Order')->load($orderId);
  $quote = $objectManager->create('\Magento\Quote\Model\Quote')->load($order->getQuoteId());

  $items = $quote->getAllItems();

  foreach ($items as $quoteItem) ...

Thank you so much for any help!

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.