Posted on

Magento 2 $quote->getAllItems(); set StoreId or Website

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:


But no luck. This is the code:

$orderId = 123;
$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$quoteToOrder = $objectManager->create(‘MagentoQuoteModelQuoteItemToOrderItem’);
$order = $objectManager->create(‘MagentoSalesModelOrder’)->load($orderId);
$quote = $objectManager->create(‘MagentoQuoteModelQuote’)->load($order->getQuoteId());

$items = $quote->getAllItems();

foreach ($items as $quoteItem) …

Thank you so much for any help!

Leave a Reply

Your email address will not be published.