Remove Category Filter in Layered Navigation – Magento 1.9

category-attributece-1.9.0.1layered-navigationlayoutmagento-1.9

After a few minutes of search, I found the solution that I'm looking for, and it's here:
How can I disable filter "category" from Sidebar

I followed this method by editing the catalog.xml by @PandaWebStudio

<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>

But sadly, It didn't work. I then scrolled down and found another solution by @Maurice

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>

It worked. It removed my category filter in the layered navigation. But the problem is, the poll and mini cart appear. And the contents of the page disappeared. Only the poll and mini cart appear in my page, there are no products and static content anymore.

I wonder where did I went wrong. I tried change the after="currency" to before="-" because that's what is inside my XML, but it still didn't work. I think I just need to modify something in the after value, because I don't have a currency block in my sidebar. That's what I don't know.

I hope a Magento guru can enlighten me. 🙁

Best Answer

jehzlau,not need xml code,If you make this category Is anchor is No the it automatically call

        <catalog_category_default translate="label">
        <label>Catalog Category (Non-Anchor)</label>
        <reference name="left">
            <block type="catalog/navigation" name="catalog.leftnav" after="currency" template="catalog/navigation/left.phtml"/>
        </reference>
.....

which is used for non-anchor category

If want using xml try this

<catalog_category_layered>
    <reference name="left">
    <remove name="catalog.leftnav" />
        <block type="catalog/navigation" name="catalog.leftnav.categories" after="currency" template="catalog/navigation/left.phtml"/>
    </reference>
</catalog_category_layered>
Related Topic