how can I sort associated products by cutom attribute within a grouped product in Magento,
I have duplicated the file Grouped.php to: app/code/local/Mage/Catalog/Model/Product/Type/Grouped.php
and tried to add this in my getAssociatedProducts function:
->addAttributeToSort('my_attribute', 'DESC');
but it don't work, can anyone help ?
[EDIT]
I have overridden the file "app/code/core/Mage/Catalog/Model/Product/Type/Grouped.php" and I have tried to sort the associated products by a custom attribute by modifying the collection like this :
$collection = $this->getAssociatedProductCollection($product)
->addAttributeToSelect('*')
->addFilterByRequiredOptions()
->setPositionOrder()
->addStoreFilter($this->getStoreFilter($product))
->addAttributeToFilter('status', array('in' => $this->getStatusFilters($product)))
->addAttributeToSort('my_attribute', 'DESC');
but that's make no change !! :(
Thanks a lot for help.