Magento News

 

magento override sort order of product list by subcategories

I’m setting up a new store using 1.4.1

I’m trying sort the products in the list by the subcategories they belong to. At the top of list.phtml is

$_productCollection=$this->getLoadedProductCollection();

I tried adding sort filters to that by adding the line

$_productCollection->setOrder('category_ids', 'asc')->setOrder('name', 'asc');

I also tried addAttributeToSort instead of setOrder. This doesn’t seem to have any effect. I’m guessing that $_productCollection is not a model I can sort in this manner. I have been digging around trying to find the correct place to apply the sort method without any success.

Can someone tell me the proper place to do this?

magento override sort order of product list by subcategories

Possibly Related Posts:


 

Leave a Reply