Skip to content

Commit 9d7da2c

Browse files
authored
ENGCOM-4506: Fixes nested array for used products cache key #21754
2 parents 557fa02 + 3a17cd2 commit 9d7da2c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,6 +1232,8 @@ public function isPossibleBuyFromList($product)
12321232
/**
12331233
* Returns array of sub-products for specified configurable product
12341234
*
1235+
* $requiredAttributeIds - one dimensional array, if provided
1236+
*
12351237
* Result array contains all children for specified configurable product
12361238
*
12371239
* @param \Magento\Catalog\Model\Product $product
@@ -1245,9 +1247,12 @@ public function getUsedProducts($product, $requiredAttributeIds = null)
12451247
__METHOD__,
12461248
$product->getData($metadata->getLinkField()),
12471249
$product->getStoreId(),
1248-
$this->getCustomerSession()->getCustomerGroupId(),
1249-
$requiredAttributeIds
1250+
$this->getCustomerSession()->getCustomerGroupId()
12501251
];
1252+
if ($requiredAttributeIds !== null) {
1253+
sort($requiredAttributeIds);
1254+
$keyParts[] = implode('', $requiredAttributeIds);
1255+
}
12511256
$cacheKey = $this->getUsedProductsCacheKey($keyParts);
12521257
return $this->loadUsedProducts($product, $cacheKey);
12531258
}

0 commit comments

Comments
 (0)