Nils-Fredrik
Nils-Fredrik

Reputation: 61

Magento category order on frontend

I want to change the default order of categories in Magento frontend navigation to order by name. Running Magento 1.5.

Does anyone have a clue?

Upvotes: 0

Views: 3755

Answers (4)

Sumith Harshan
Sumith Harshan

Reputation: 6445

In Admin Panel go to Catalog—>Manage Categories. From there you can change categories order by just drag-and-dropping categories right in category tree at the left-hand side of the page. Good luck!!!

Upvotes: 0

Vern Burton
Vern Burton

Reputation: 3210

You would need to build the collection first, then sort the attribute

Mage::getModel('catalog/category')->getCollection()->addFieldToFilter('parent_id', '319')->addAttributeToSort('name', 'ASC');

Upvotes: 0

clockworkgeek
clockworkgeek

Reputation: 37700

You can manually order the categories in admin by dragging them up and down in the left pane of "Manage Categories" page.

Upvotes: 1

Kenny
Kenny

Reputation: 5410

We have been searching on a way to do this also, and ended up doing this:

<?php
...
$categories = array(1,3,5); // this holds the category ids you want to show, in the correct order
foreach($categories as $cat){
  Mage::getModel("catazlog/category")->load($cat);
  // Do whatever you want here
}
?>

It definitely isn't the cleanest way to achieve what you are trying to do, but just offering you a quick (dirty?) solution.

-Kenny

Upvotes: 0

Related Questions