4
votes

I have 4 categories within the 'Default Category' category. Currently by default Magento is generating the header-nav from 'Default Category', and displaying the 4 categories at the top of my site. The "Products" category is in the "Default Cateogry". Inside the "Products" category are the sub categories that i want to have displayed on my top nav.

Default Category:

  • Products
  • Featured Products
  • Popular Products
  • Applications

The product/category setup is what was given to me on this project, which is what i want to make work without having to redo(as there are a couple hundred products already created). Had i started from scratch, the product/category setup would be different.

In app/code/core/Mage/Catalog/Block/Navigation.php I found that the menu is generated using the function getStoreCategories(), which it would seem pulls everything from the 'Default Category' category.

So I guess I'm looking for 1 of 3 solutions:

  1. A way from within the Magento admin to chose which category to use to generate the top menu.

  2. Which function to use, that is not getStoreCategories, so I can specify the parent category, and modify app/code/core/Mage/Catalog/Block/Navigation.php

  3. Or is this something I can manipulate somewhere in the layout xml files along with a custom template piece if necessary.

Any suggestions would be greatly appreciated. Thank you in advance.

2

2 Answers

3
votes

In the site's store setup, you can choose which "root" category to use as the store's category layout. Note that you may only choose root categories for this. Please modify your post with what your intention is here if you need further help in structuring your categories.

Head to System -> Manage Stores and click on one of the links under Store Name

-1
votes

You can also specify the ID of the root category used for the main navigation by modifying the file situated in:

app > code > core > Mage > Catalog > Helper > Category.php

Looks for the function "getStoreCategories()" and change

$parent     = Mage::app()->getStore()->getRootCategoryId();

with your root category ID

$parent     = YOUR-ID;

Everything works fine for me with this trick.