Magento 2.x Enable / Disable Layered Navigation in Catalog Pages

What is Layered Navigation : It is used in the left column of search results and category pages as well as sometimes on the home page.

Various Layered Navigation :

  • Shop By list of categories
  • Shop By Price
  • Shop By Size
  • Shop By Color
  • Shop By Height
  • Shop By Weight

How Do Enable / Disable Layered Navigation in Catalog Pages : The following two methods are used.

Method -1 :: By Admin Setting as below

Step [1]- Go to Admin panel, Store > Attributes > Product.

Step [2]- You will see a list of all attributes.

Step [3] – Click on the attributes you want to remove, here we have selected color, it will redirects on color attribute details page

  • On the left, choose Storefront Properties. The Storefront Properties appear.
  • Look for Use in Layered Navigation, then switch it to No.

Step [4]- Finally click on Save Attribute Button & run CLI flush command & your changes would be reflected on frontend.

Method -2 :: By Coding as below

To disable Layered Navigation entirely, Need to edit the code of the catalog.xml

Step [1]- Go to below file path

app/design/frontend/base/default/layout/catalog.xml. In this file, find the code

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

Step [2]- Comment entire code as below

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

Step [3]- After your changes, flush the Magento cache and refresh the frontend to see the result.

Leave a Reply

Your email address will not be published. Required fields are marked *