1

How can I make the Parent link show but without anchor and can still hover so the sub categories will show and can click?

And is there a way for me to remove the "View all" link only under a specific parent link?

Thanks!

enter image description here

1
 if($category->getLevel()== 2 && $hasActiveChildren) {
            $html[] = '<a href="'.$this->getCategoryUrl($category).'"'.$linkClass.' onclick="return false;">';
            $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>';
} 

Hello, To remove url, href functionality of the top menu categories, you can take the following steps:

  1. Create some folder as this path: app/code/local/Mage/Catalog/Block
  2. Copy file Navigation.php from app/code/core/Mage/Catalog/Block to add to app/code/local/Mage/Catalog/Block
  3. Go to function _renderCategoryMenuItemHtml(), line 285 and put the above code:

you can find reference here

|improve this answer|||||
  • Is there any other way through xml so I can add it over the admin? because I don't want to change the core codes – Alyssa Reyes Nov 20 '14 at 6:47
  • no not possible through admin section – dh47 Nov 20 '14 at 8:38
1

Go to

\app\design\frontend\rwd\default\template\page\html\topmenu\renderer.phtml

Search for word'View All' and comment that code.

|improve this answer|||||
0

In addition to Anisha Recommendation of removing the View All, to remove parent link option find the following code

$html .= '<a href="'. $child->getUrl() .'" class="'. $outermostClassCode .' '.        $_hasChildren .'">'. $this->escapeHtml($this->__($child->getName())) .'</a>';`

And Add if statement to check if its a parent link.

if($_hasChildren)
    { $html .= '<a href="#" class="'. $outermostClassCode .' '. $_hasChildren .'">'. $this->escapeHtml($this->__($child->getName())) .'</a>';   
    }
    else
    {
        $html .= '<a href="'. $child->getUrl() .'" class="'. $outermostClassCode .' '. $_hasChildren .'">'. $this->escapeHtml($this->__($child->getName())) .'</a>';

        }
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.