Outstanding and responsive customer support manaDEV has. Their support led me through the process of installing and configuring it, when problems show ... Read more

Jul 2, 2014 Professor62

Certified Magento Enterprise developer Certified Magento developer Certified Magento theme developer Certified Magento specialist

Manadev is certified extension and theme
developer for Magento

How to Hide a Filter in Specific Category

You can hide and show layered navigation filters in specific categories using layout updates.

Examples

To hide price filter in left layered navigation block, add the following to category layout update field:

<referenceContainer name="sidebar.main">
    <referenceBlock name="main.mana.layered_nav">
        <action method="hide">
            <argument name="name" xsi:type="string">price</argument>
        </action>       
    </referenceBlock>
</referenceContainer>

To hide all filters above product list, add the following to category layout update field:

<referenceContainer name="content">
    <referenceBlock name="above_products.mana.layered_nav">
        <action method="hideAll" />
    </referenceBlock>
</referenceContainer>

To show price filter above product list and hide all other filters, add the following to category layout update field:

<referenceContainer name="content">
    <referenceBlock name="above_products.mana.layered_nav">
        <action method="hideAll" />
        <action method="show">
            <argument name="name" xsi:type="string">price</argument>
        </action>       
    </referenceBlock>
</referenceContainer>

Specifying Layered Navigation Block

There are up to 4 layered navigation blocks on the page, and in each of them, you can hide and show filters:

  • In layered navigation in main sidebar:

    <referenceContainer name="sidebar.main">
        <referenceBlock name="main.mana.layered_nav">
            <!-- one or more filter hiding/showing instructions -->     
        </referenceBlock>
    </referenceContainer>
    
  • In layered navigation above products:

    <referenceContainer name="content">
        <referenceBlock name="above_products.mana.layered_nav">
            <!-- one or more filter hiding/showing instructions -->     
        </referenceBlock>
    </referenceContainer>
    
  • In layered navigation displayed on mobile devices:

    <referenceContainer name="content">
        <referenceBlock name="mobile.mana.layered_nav">
            <!-- one or more filter hiding/showing instructions -->     
        </referenceBlock>
    </referenceContainer>
    
  • In layered navigation in additional sidebar:

    <referenceContainer name="sidebar.additional">
        <referenceBlock name="additional.mana.layered_nav">
            <!-- one or more filter hiding/showing instructions -->     
        </referenceBlock>
    </referenceContainer>
    

Hide/Show Instructions

Hiding specified filter:

<action method="hide">
    <argument name="name" xsi:type="string">attribute_code</argument>
</action>       

Hiding all filters:

<action method="hideAll" />

Showing specified filter:

<action method="show">
    <argument name="name" xsi:type="string">attribute_code</argument>
</action>       

Showing all filters:

<action method="showAll" />

Hiding/Showing Filters In List Of Applied Filters

In addition to hiding filters from layered navigation, you may also hide applied filter from list of applied filters which typically appears at the top of layered navigation block.

Hiding specified filter:

<action method="hideAppliedFilter">
    <argument name="name" xsi:type="string">attribute_code</argument>
</action>       

Hiding all filters:

<action method="hideAllAppliedFilters" />

Showing specified filter:

<action method="showAppliedFilter">
    <argument name="name" xsi:type="string">attribute_code</argument>
</action>       

Showing all filters:

<action method="showAllAppliedFilters" />

We Accept: PayPal Visa MasterCard American Express Discover