How can I check if product is a Grouped Product?

I tried:

<?php if( $_products->isGrouped() ) ?>

but doesn't work.

  • Is that a typo, or did you really use $_products (ending with s). By convention that is the collection, not the product model. – Melvyn Nov 11 '14 at 7:47

Another way to check the product is grouped or not.

<?php if( $_product->getTypeId() == 'simple' ): ?>
//your code for simple products only
<?php endif; ?>

<?php if( $_product->getTypeId() == 'grouped' ): ?>
//your code for grouped products only
<?php endif; ?>

So on. Place this code in the catalog/product/view.phtml

| improve this answer | |

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.