user3659776
user3659776

Reputation: 19

Magento 1.9 Duplicate View all title in sub-category

When I define a subcategory (i.e. sub1) in a category (i.e. main1), the resulting top menu displays:

1.The title of the category (main1)

2.The submenu with 2 option

I don't understand why the name of the category is duplicated in the subcategory with 'View all' in front of the name.

Do you know how to disable it?

Upvotes: 1

Views: 1476

Answers (2)

AidanS
AidanS

Reputation: 11

I think you need to get rid of the first "View All SubcategoryName" link. If you need that, just change the code like this:

    $html .=     '<li class="level'. $nextChildLevel .'">';
    $html .=         '<a class="level'. $nextChildLevel .'" href="'. $child->getUrl() .'">';
                        if($childLevel > 1) {   
    $html .=                $this->escapeHtml($this->__($child->getName()));
                        }
    $html .=         '</a>';
    $html .=     '</li>';

Good luck.

Upvotes: 0

Brijn Webproducts
Brijn Webproducts

Reputation: 86

You can disable this by going to the file app/design/frontend/???/your-template/template/page/html/topmenu/renderer.phtml

Then comment out line 64 to 68 which should be:

$html .=     '<li class="level'. $nextChildLevel .'">';
$html .=         '<a class="level'. $nextChildLevel .'" href="'. $child->getUrl() .'">';
$html .=             $this->__('View All ') . $this->escapeHtml($this->__($child->getName())); 
$html .=         '</a>';
$html .=     '</li>';

this way you comment out the "View all", if you comment out the whole block, you will not get a submenu.

Upvotes: 2

Related Questions