I encountered this error more than I think. Either $_product->hasOptions() , or $_product->hasCustomOptions() always returns false . I still donβt know why this error occurs.
In any case, you can get the same result by doing the following. For custom products:
<?php if ( $_product->getData('has_options') ): ?> <?php endif; ?>
And get the same result for simple products with customizable options:
<?php if ( $_product->getData('has_options') && ($_product->getTypeID() == 'simple') ): ?> <?php endif; ?>
I hope this helps the future adventurer!
EDIT
The above solution does not work in cycles when a parameter parameter with a flat category is included in Magento, and we do not want to reload the product inside the foreach cycle!
Instead, we can check the settings using the following single element inside the loop:
$opts = Mage::getSingleton('catalog/product_option')->getProductOptionCollection($_product); $optsSize = $opts->getSize(); if ( $optsSize ) { ...
Jongosi
source share