jcadima
3/31/2015 - 4:14 PM

make magento top links with sub categories not clickable

make magento top links with sub categories not clickable

<?php
/*create the following local file and copy from core:
/app/code/core/Mage/Page/Block/Html/Topmenu.php

create->  /app/code/local/Mage/Page/Block/Html/Topmenu.php


*/
// edit line around: 130

          $html .= '<li ' . $this->_getRenderedMenuItemAttributes($child) . '>';
            
      //  $html .= '<a href="' . $child->getUrl() . '" ' . $outermostClassCode . '><span>'    
      //  . $this->escapeHtml($child->getName()) . '</span></a>';
                
           if ($child->hasChildren() && $childLevel == 0 ) {
	        $html.= '<a href="#" ' . $outermostClassCode . ' onclick="return false;"><span>'
	        . $this->escapeHtml($child->getName()) . '</span></a>'."\n";
			    }
		    else {
		        $html .= '<a href="' . $child->getUrl() . '" ' . $outermostClassCode . '><span>'
		        . $this->escapeHtml($child->getName()) . '</span></a>';
		    }