The last answer here is exactly what I'm looking for, but I want to do it the clean way:
How to sort associated products in a grouped product

Has anybody a solution to achieve this within the grouped.phtml I rather don't want to open up an own module just for this sorting.

I tried $_associatedProducts = $this->getAssociatedProducts($_product)->addAttributeToSort('entity_id', 'ASC');but that doesn't work.

1 Answer 1


I tested this on 1.9 and you might put this code into a helper but if you look at the code which gets the associated products it eventually calls Mage_Catalog_Model_Product_Type_Grouped->getAssociatedProducts()

The code below sets the order by price and descending.

$_product = $this->getProduct();
$_grouped =  Mage::getModel('catalog/product_type_grouped');
$_storeFilter = $_grouped->getStoreFilter($_product);
$_status = $_grouped->getStatusFilters($_product);

/** @var Mage_Catalog_Model_Resource_Product_Link_Product_Collection $_associatedProducts */
$_associatedProducts = $_grouped
     ->addAttributeToFilter('status', array('in' => $_status));

// Add custom filtering here
$_associatedProducts->setOrder('price', 'DESC');
  • No problem at all. I am glad it helped :) Jul 28, 2015 at 21:26

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.