Question

I am looking a way to disable clicking of a Parent category Button in Magento Navigation Menu. I found lot of examples on how disable "all parent first level" clicking buttons, but not just for one category button. I tryed with url rewrite without success. Any idea on how achive this ?

Was it helpful?

Solution

Go to the Navigation.php

class Mage_Catalog_Block_Navigation 

change as below.

protected function _renderCategoryMenuItemHtml($category, $level = 0, $isLast = false, $isFirst = false,
        $isOutermost = false, $outermostItemClass = '', $childrenWrapClass = '', $noEventAttributes = false)
    {
...
if($level==0){
        $html[] = '<a href="#"'.$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>';
    }

 ...
}

Flush cache after that

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top