0

I referred the link : stackexchange but I am not getting any results. I have used following code in Magento_Catalog/templates/product/list.phtml

$configurableOptions = $_product->getConfigurableAttributesData();

    foreach ($configurableOptions['matrix'] as $option) {
       echo $option['price'];
    }

I got an error like : Warning: Invalid argument supplied for foreach() in Magento_Catalog/templates/product/list.phtml

2

try this

$_children = $_product->getTypeInstance()->getUsedProducts($_product);
                    foreach ($_children as $child){
                        echo $child->getPrice();
                    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.