Here is a simple trick to get the sub-products of a grouped product on the category products listing page. Add the following code to the products list.phtml file.
$_associatedProducts = array();
if ($_product->getTypeId() == 'grouped')
{
$_associatedProducts = $_product->getTypeInstance(true)->getAssociatedProducts($_product);
}
Once you collect all simple product data associated with the grouped product, you can loop through the array and display the simple product’s data.
Great post, thank you.
great but in fact I just want to do the opposite.
I mean, I have one or more products and I want get the grouped product, thanks
Hi could you tell where in this file i need to add this code
cheers
oh im using the newest version, if that makes and difference
Within your template directory, you will find the Catalog/Products/List.phtml file.