19oct/100
Magento : Add sorting condition
Today, I add to make my category menu reflect the category order in the backend (not ordered by name).
The only thing you have to do is to add “addAttributeToSort(‘attName’, ‘sortDirection’)” in your template the next function in the loading instruction.
$collection = Mage::getResourceModel(’catalog/category_collection’)
->addAttributeToSelect(’name’)
->addAttributeToSort('position', 'asc')
->addAttributeToFilter('is_active', 1)
->load();
Hope it’ll help you too.
Enjoy

Posts that maybe you want to read ::
Commentaires (0)
Trackbacks (0)
(Souscrire aux commentaires de cet article)
Aucun trackbacks pour l'instant
