4

How can I check if product is a Grouped Product?

I tried:

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

but doesn't work.

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

1 Answer 1

7

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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