$sale_products = Mage::getModel('catalog/product')->getCollection(); $sale_products->addAttributeToSelect(array( 'image', 'name', 'short_description', )) ->addFieldToFilter('visibility', array( Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH, Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG )) ->addFieldToFilter('feature', array('eq' => 1)) ->addAttributeToSort('position', 'ASC') ->addFinalPrice() ->getSelect() ->where('price_index.final_price < price_index.price')
Right now I only know how to sort by position. and I believe the position is sorted by the date item become sale.
If I sort by
->addAttributeToSort('category_id', 'ASC') I am not sure if it have any effect. b/c product have many category ids. and I can't find a pattern that match.
How to sort Product by it's parent category position?