cancel
Showing results for 
Search instead for 
Did you mean: 

Turn off "View All" option

SOLVED

Turn off "View All" option

My boss wants me to not have the "View All" option in the navigation menus. This is because the top level category is often empty of products that appear in sub-categories only. In these instances, selecting the "View All" option for that category results in the following message: "There are no products matching the selection". My boss thinks this confusing even though the subcategories all show items present. Eliminating the "View All" option or changing the "There are no products matching the selection" message are both viable solutions.

3 REPLIES

Re: Turn off "View All" option

Hello DennisAtPS,

 

You go to your current package and find in template folder: page/html/topmenu/renderer.phtml. And, you can see

 

......
 if (!empty($_hasChildren)) {
        $html .= '<ul class="level'. $childLevel .'">';
        $html .=     '<li class="level'. $nextChildLevel .' view-all">';
        $html .=         '<a class="level'. $nextChildLevel .'" href="'. $child->getUrl() .'">';
        $html .=             $this->__('View All') . ' ' . $this->escapeHtml($this->__($child->getName()));
        $html .=         '</a>';
        $html .=     '</li>';
        $html .=     $this->render($child, $childrenWrapClass);
        $html .= '</ul>';
    }
......

 You remove these lines:

 

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

Problem solved? Click Accept as Solution!

Re: Turn off "View All" option

Oopps. That only removes the "View All" option after a selection has been made. When the site is first opened or refreshed the "View All" option is still there.  Is there also a way to change the default message if a visitor clicks directly on the top level category link anyway?

Re: Turn off "View All" option

Hello DennisAtPS,

 

You find this line in your current template: template/catalog/product/list.phtml. You can see near the top of this file:

......
<?php
    $_productCollection=$this->getLoadedProductCollection();
    $_helper = $this->helper('catalog/output');
?>
<?php if(!$_productCollection->count()): ?>
<p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p>
<?php else: ?>
<div class="category-products">
    <?php echo $this->getToolbarHtml() ?>
    <?php // List mode ?>
    <?php if($this->getMode()!='grid'): ?>
......

 

Problem solved? Click Accept as Solution!