5

I choose my Category XY and get the Product-Grid, on the left side there is the Sub-navigation and below the "Filter Navigation".

The attribute filters starts with "categories", "manufacturer", "size", ..

How can I disable/remove the filter "categories" from sidebar?

I tried per CSS with

#narrow-by-list dt:first-child {display:none;}

but I cannot remove the categories itself. In which XML I have to remove some blocks? I have no idea .. Thanks for your help.

1
  • Go to Catalog > Attribute > Manage Attribute and go to the price attribute and color attribute click on both and in frontend properties their is "Use In Layered Navigation" make it as NO. and save Commented Jun 18, 2015 at 13:00

5 Answers 5

21

In your theme catalog.xml file replace the following line

<block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml" />

with

<block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml">
    <action method="unsetChild"><child>category_filter</child></action>
</block>

If you're curious why it works, see Mage_Catalog_Block_Layer_View::_prepareLayout()

5
  • It works, thank you! Yeah, I'm curious .. but still after looking at Mage_Catalog_Block_Layer ... ;) It's time for a Magento-Dev.Book ... Commented Jul 3, 2013 at 7:43
  • 2
    Why should they not do this in the theme's local.xml?
    – benmarks
    Commented Jul 3, 2013 at 11:50
  • I don't know ;) Here's the local.xml from my theme: jsfiddle.net/mobilat/977BN Should I try it with the local.xml - but it works anyway. Commented Jul 3, 2013 at 15:22
  • Cool, but it is not working with the Bubblesearch catalog search page...
    – tread
    Commented Oct 27, 2016 at 9:31
  • Ahh this works: <reference name="catalogsearch.leftnav"> <action method="unsetChild"><alias>category_filter</alias></action> </reference>
    – tread
    Commented Oct 27, 2016 at 9:36
3

I realize that this is an older question, but I found this via Google. For any fellow (future) Googlers;

The (currently) recommended way to make layout changes is using a theme's local.xml. So when using local.xml, add the following:

    <catalog_category_layered>
         <reference name="catalog.leftnav">
            <action method="unsetChild"><child>category_filter</child></action>
        </reference>
    </catalog_category_layered>

And if you want, you can add the regular (non-filterable) category menu above the filters like by adding the following to your local.xml:

    <catalog_category_layered>
        <reference name="left">
            <block type="catalog/navigation" name="catalog.leftnav.categories" after="currency" template="catalog/navigation/left.phtml"/>
        </reference>
        <reference name="catalog.leftnav">
            <action method="unsetChild"><child>category_filter</child></action>
        </reference>
    </catalog_category_layered>
0

I used Maurice's answer but modified it slightly:

<reference name="left">
    <block type="catalog/navigation" name="catalog.leftnav.categories" template="catalog/navigation/sidebar.phtml"/>
    <block type="catalog/layer_view" name="catalog.leftnav" template="catalog/layer/view.phtml">
        <action method="unsetChild"><alias>category_filter</alias></action>
    </block>
</reference>
0

Remove Category option from Layered Navigation options list in magento

This is what I did to remove the “Category” section from my layered navigation so I wouldnt have any repeat information with the attributes I wanted in the layered navigation. go to app/design/frontend/default/default/template/catalog/layer and open up view.phtml for edit.

<dl id="narrow-by-list"><?php $_filters = $this->getFilters() ?>
<?php foreach ($_filters as $_filter): ?>
 <?php if($_filter->getItemsCount()): ?>
<?php if($_filter->getName() != "Category"){ ?><dt><?php echo $this->__($_filter->getName()) ?></dt>
<dd><?php echo $_filter->getHtml() ?></dd><?php } endif; ?>
<?php endforeach; ?></dl>
0

This is very old question but it can help to any one who have same stuff like me.

To Remove category list from sidebar you can modify xml files as below.

Remove from layered navigation:

Add below code in local.xml file if theme have such file:

<catalog_category_layered>
     <reference name="catalog.leftnav">           
        <action method="unsetChild">
            <child>category_filter</child>
        </action>
    </reference>
</catalog_category_layered>

Add below code in catalog.xml file if local.xml not exists:

<block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml">
    <action method="unsetChild">
        <child>category_filter</child>
    </action>       
</block>

Remove from category default page:

Add below code in local.xml file if theme have such file:

<reference name="catalog.leftnav" >       
    <action method="unsetChild">
         <child>category_filter</child>
    </action>
</reference>

Add below code in catalog.xml file if local.xml not exists:

 <block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml">
   <action method="unsetChild">
         <child>category_filter</child>
    </action>
 </block>

Remove from catalog search page:

Add below code in local.xml file if theme have such file:

<catalogsearch_result_index>
   <reference name="catalog.leftnav">           
        <action method="unsetChild">
            <child>category_filter</child>
        </action>
    </reference>
</catalogsearch_result_index>

Add below code in catalogsearch.xml file if local.xml not exists:

<block type="catalogsearch/layer" name="catalogsearch.leftnav" after="currency" template="catalog/layer/view.phtml">
      <action method="unsetChild">
            <child>category_filter</child>
        </action>
</block>

Note: Please clear your cache if you have enabled it in your admin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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