1

On the category page (in list.phtml) I need to check if a product has custom options. What is the best way to do that without abusing the objectmanager?

3

Try to use

$isHasOptions = $product->getTypeInstance()->hasOptions($product);
0

Thanks @Tuyen Nguyen!

Got it working:

<?php $ProductHasOptions = $_product->getTypeInstance()->hasOptions($_product); ?>

<?php if( $ProductHasOptions == 1 ) { ?>
    With options
<?php } else { ?>
    No options
<?php } ?>

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.