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 @@
 <?php
 /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
+ * Copyright 2011 Adobe
+ * All Rights Reserved.
  */
+
 declare(strict_types=1);
 
 namespace Magento\Quote\Model\ResourceModel\Quote\Item;
@@ -193,7 +194,10 @@ protected function _afterLoad(): self
     {
         parent::_afterLoad();
 
-        $productIds = [];
+        /** @var QuoteItem $item */
+        $productIds = array_map(fn ($item) => (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
          */
