From 80c0d08f375b022b32cf1389eab4bd9ca55ccb09 Mon Sep 17 00:00:00 2001 From: bhennes Date: Thu, 20 Feb 2025 10:41:07 +0100 Subject: [PATCH] #39641 Replace loop variable name to correct the "cache" effect on subsequent calls on the same $product object --- .../ConfigurableProduct/Model/Product/Type/Configurable.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php b/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php index 20b54b82a2234..375bb0cdeb490 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php @@ -552,8 +552,8 @@ public function getUsedProductIds($product) { if (!$product->hasData($this->_usedProductIds)) { $usedProductIds = []; - foreach ($this->getUsedProducts($product) as $product) { - $usedProductIds[] = $product->getId(); + foreach ($this->getUsedProducts($product) as $childProduct) { + $usedProductIds[] = $childProduct->getId(); } $product->setData($this->_usedProductIds, $usedProductIds); }