Skip to content

Commit da126e0

Browse files
MAGETWO-67010: [Performance] Swatches real server side optimization
1 parent 645e6e0 commit da126e0

File tree

1 file changed

+3
-1
lines changed
  • app/code/Magento/ConfigurableProduct/Helper

1 file changed

+3
-1
lines changed

app/code/Magento/ConfigurableProduct/Helper/Data.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,11 @@ public function getGalleryImages(\Magento\Catalog\Api\Data\ProductInterface $pro
7676
public function getOptions($currentProduct, $allowedProducts)
7777
{
7878
$options = [];
79+
$allowAttributes = $this->getAllowAttributes($currentProduct);
80+
7981
foreach ($allowedProducts as $product) {
8082
$productId = $product->getId();
81-
foreach ($this->getAllowAttributes($currentProduct) as $attribute) {
83+
foreach ($allowAttributes as $attribute) {
8284
$productAttribute = $attribute->getProductAttribute();
8385
$productAttributeId = $productAttribute->getId();
8486
$attributeValue = $product->getData($productAttribute->getAttributeCode());

0 commit comments

Comments
 (0)