diff --git a/vendor/magento/module-quote/Model/ResourceModel/Quote/Item/Collection.php b/vendor/magento/module-quote/Model/ResourceModel/Quote/Item/Collection.php index 01a4e0c5e8e64..defbc1edfa19e 100644 --- a/vendor/magento/module-quote/Model/ResourceModel/Quote/Item/Collection.php +++ b/vendor/magento/module-quote/Model/ResourceModel/Quote/Item/Collection.php @@ -1,8 +1,9 @@ (int) $item->getProductId(), $this->getItems()); + $this->_productIds = array_merge($this->_productIds, $productIds); + $this->removeItemsWithAbsentProducts(); foreach ($this as $item) { // Assign parent items if ($item->getParentItemId()) { @@ -202,11 +206,7 @@ protected function _afterLoad(): self if ($this->_quote) { $item->setQuote($this->_quote); } - // Collect quote products ids - $productIds[] = (int)$item->getProductId(); } - $this->_productIds = array_merge($this->_productIds, $productIds); - $this->removeItemsWithAbsentProducts(); /** * Assign options and products */