从Magento中的特定子类别中删除定位标记

从Magento中的特定子类别中删除定位标记,magento,magento-1.9,magento-1.9.1,Magento,Magento 1.9,Magento 1.9.1,我想禁用两个子类别的锚定标记。我使用了topmenu的免费扩展名。子类别菜单的代码为: public function drawMenuItem($children, $level = 1) { $html = '<div class="itemMenu level' . $level . '">'; $keyCurrent = $this->getCurrentCategory()->getId(); foreac

我想禁用两个子类别的锚定标记。我使用了topmenu的免费扩展名。子类别菜单的代码为:

public function drawMenuItem($children, $level = 1)
    {
        $html = '<div class="itemMenu level' . $level . '">';
        $keyCurrent = $this->getCurrentCategory()->getId();
        foreach ($children as $child) {
            if (is_object($child) && $child->getIsActive()) {
                // --- class for active category ---
                $active = '';
                if ($this->isCategoryActive($child)) {
                    $active = ' actParent';
                    if ($child->getId() == $keyCurrent) $active = ' act';
                }
                // --- format category name ---
                $name = $this->escapeHtml($child->getName());
                if (Mage::getStoreConfig('custom_menu/general/non_breaking_space')) $name = str_replace(' ', '&nbsp;', $name);
                $html.= '<a class="itemMenuName level' . $level . $active . '" href="' . $this->getCategoryUrl($child) . '"><span>' . $name . '</span></a>';
                $activeChildren = $this->_getActiveChildren($child, $level);
                if (count($activeChildren) > 0) {
                    $html.= '<div class="itemSubMenu level' . $level . '">';
                    $html.= $this->drawMenuItem($activeChildren, $level + 1);
                    $html.= '</div>';
                }
            }
        }
        $html.= '</div>';
        return $html;
    } 
公共函数drawMenuItem($children,$level=1)
{
$html='';
$keyCurrent=$this->getCurrentCategory()->getId();
foreach($childrenas$child){
如果(是对象($child)&&$child->getIsActive()){
//---活动类别的类别---
$active='';
如果($this->isCategoryActive($child)){
$active='actParent';
如果($child->getId()=$keyCurrent)$active='act';
}
//---格式类别名称---
$name=$this->escapeHtml($child->getName());
如果(Mage::getStoreConfig('custom_menu/general/non_breaking_space'))$name=str_replace(''',$name);
$html.='';
$activeChildren=$this->\u getActiveChildren($child,$level);
如果(计数($activeChildren)>0){
$html.='';
$html.=$this->drawMenuItem($activeChildren,$level+1);
$html.='';
}
}
}
$html.='';
返回$html;
} 

我试图禁用这两个子类别。但它不起作用。我如何才能给出适当的条件来禁用特定的两个子类别链接?

如果只有两个子类别,为什么不使用JS呢。向每个项目菜单添加一个id,将其作为目标并删除href$(“a”)。removeAttr(“href”);子菜单是动态出现的,那么如何为特定的两个子类别添加id。正如您在上面代码中所看到的,这是对所有人的