My magento version is 1.9 and i am using rwd theme.
I want to remove link from the menu on homepage… I tried the following stuff but it didn't work:
- Create some folder as this path:
app/code/local/Mage/Catalog/Block
- Copy file Navigation.php from
app/code/core/Mage/Catalog/Block
toapp/code/local/Mage/Catalog/Block
-
Go to function
_renderCategoryMenuItemHtml()
Replace the code$html[] = '<a href="'.$this->getCategoryUrl($category).'"'.$linkClass.'>'; $html[] = '<span>' . $this->escapeHtml($category->getName()) . '</span>'; $html[] = '</a>';
with this code
if($category->getLevel()== 2 && $hasActiveChildren) { $html[] = '<a href="[removed]void(0);"'.$linkClass.'>'; $html[] = '<span>' . $this->escapeHtml($category->getName()) . '</span>'; $html[] = '</a>'; } else { $html[] = '<a href="'.$this->getCategoryUrl($category).'"'.$linkClass.'>'; $html[] = '<span>' . $this->escapeHtml($category->getName()) . '</span>'; $html[] = '</a>'; }
Best Answer
If i understand your request correctly, you want to remove a category in your main product category structure from the main menu.
You can do this in the admin of your site
catalog->manage-categories
. Select the category you wish to hide and under thegeneral information
tab you have theInclude in Navigation Menu *
option that you can set tono
.