I could not find any option to make the categories appear in the order you defined them. But you can modify /app/code/core/Mage/Catalog/Model/Layer/Filter/Category.php.
Just add addAttributeToSort(’position’, ‘asc’) sorting criteria to the function that loads the child categories collection that will be used in the Shopping Filter block.
Looks like the code addAttributeToSort(’position’, ‘asc’) is added to v1.1.2. However, it doesn’t do a damn thing with the layered navigation (filter) on the left sidebar as the OP had asked for.
You’ll notice I added “addAttributeToSort($sort_by, $sort_order)” and “addAttributeToSelect(’image’)”. Wondering why I added “addAttributeToSelect(’image’)”?
You’ll love me later, because you can now use the function getImage() from any category object, such as $category->getImage();
I use it to create thumbnails for all my categories.
Here are the uses of the new getCurrentChildCategories() function:
sort_by - what attribute you want to sort by, such as ‘name’ or ‘position’
sort_order - ‘asc’ or ‘desc’. defaults to asc (ascending order)
examples:
getCurrentChildCategories() - nothing gets sorted
getCurrentChildCategories(’’name”, “desc") - sort by name in descending order
getCurrentChildCategories(’’position") - sort by position in ascending order, like you see in the category listing under the magento admin
OKAY. So how do I make it work in the layered navigation (filter)?
Under the theme (skin) you are using. Modify the file “template/catalog/navigation/left.phtml”
<?php foreach ($this->getStoreCategories() as $_category): ?>
to
<?php foreach ($this->getCurrentChildCategories('name') as $_category): ?>
When i change that the site goes funky. The top menu is replaced with all the child categories sorted and the home page gives a fatal error undefined function getChildren. I will keep working on it.
Always nice to know that updates make things worse.
I have not created a functional store yet, this is all for experimentation and custom theme creation so I can delete the categories and re-do them so they are in order on the main page but I expect this to be a little more user friendly than this.
I know this is a new cart but they consider it revolutionary, well with everything hidden in a ton of folders with no real instruction manual it has only been a revolution in confusion.
You’ll notice I added “addAttributeToSort($sort_by, $sort_order)” and “addAttributeToSelect(’image’)”. Wondering why I added “addAttributeToSelect(’image’)”?
You’ll love me later, because you can now use the function getImage() from any category object, such as $category->getImage();
I use it to create thumbnails for all my categories.
Good stuff, hyteckit!
I tried to figure out how to create thumbnails for my sub categories, but it’s not as easy at it seems. Did you extend class Mage_Catalog_Helper_Image in order to achieve this?
hyteckit, thank you and you rock man!
tell me though, is there anyway we can add this as a module to have a field in the admin panel that says : sort order and you specify a value to the category..?
also another thing I am wondering, and this might be completely of the topic, please excuse me if it is, is i want to make a dynamic sidebar (left coulumb) so that when you are on a product view page and you have the vertical menu on the left pulling in “products” associated with a category, how to I manipulate the order of those “products”?
once again, this whole community rocks man, and the application is so cool!