From c0f9508818a29d4f49c426ef9d8b4f6dca173682 Mon Sep 17 00:00:00 2001 From: Teun Lassche Date: Wed, 9 Nov 2016 11:36:52 +0100 Subject: [PATCH] Fix issue #6999: Configurable attribute cache was never hit --- .../ConfigurableProduct/Model/Product/Type/Configurable.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php b/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php index 0b8a4aee9fece..3c888aca7896b 100644 --- a/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Model/Product/Type/Configurable.php @@ -443,15 +443,15 @@ public function getConfigurableAttributes($product) */ protected function hasCacheData($configurableAttributes) { - $configurableAttributes = $configurableAttributes ?: unserialize($configurableAttributes); - if (is_array($configurableAttributes) && count($configurableAttributes)) { + $configurableAttributes = $configurableAttributes ? unserialize($configurableAttributes) : $configurableAttributes; + if ((is_array($configurableAttributes) || $configurableAttributes instanceof \Traversable) && count($configurableAttributes)) { foreach ($configurableAttributes as $attribute) { /** @var \Magento\ConfigurableProduct\Model\Product\Type\Configurable\Attribute $attribute */ if ($attribute->getData('options')) { return $configurableAttributes; } } - } + } return false; }