Skip to main content
Share Your Experience: Take the 2024 Developer Survey
16 votes

Remove Layered navigation - Magento 2

Add this to your theme default.xml <referenceBlock name="catalog.leftnav" remove="true" /> OR Add this on Admin Panel > Products > Categories > YOUR PAGE > Design <referenceContainer name=...
Qaisar Satti's user avatar
  • 32.5k
16 votes
Accepted

Magento 2 api - How to get layer navigation filters available in rest api?

There are 2 methods to achieve this First one Filter.php (api model) public function __construct(\Magento\Framework\Webapi\Rest\Request $request){ $this->...
NID's user avatar
  • 937
13 votes
Accepted

Magento 2 - All products page with layered navigation and pagination

I recently did the same sort of work. First you need to override Category block because you want the All products page just like category page. In order to, get more understanding check ...
Muhammad Hasham's user avatar
9 votes

Get attribute_code or attribute_id in layered catalog\layer\view.phtml

This will give the attribute code: $_filter->getRequestVar(); You can get attribute id by using the following: // $attributeCode = YOUR_ATTRIBUTE_CODE; // In your case it will be as below: $...
Mukesh Chapagain's user avatar
8 votes

Magento 2 : How faceted data works for layered navigation?

The code below applies to Magento 2.2.5. First off, in the sidebar, all possible ranges for all possible filters need to be produced. Additionally, to this, you will have the overview of the count of ...
Marjan's user avatar
  • 1,139
7 votes
Accepted

How to update category page with custom filters, and also layered navigation, Magento 2.1

I have found answer to my question To apply custom filter in category, please do as below 1] create custom SKU filter with the help of search_request.xml create search_request.xml file in ...
Nalin Savaliya's user avatar
7 votes

Attribute is not appearing on layered navigation in Magento 2

Lets say you have an attribute called manufacturer. Then you have 5 products with the same value for manufacturer (ex. Brand X) the the manufacturer attribute will not show on the Layered navigation ...
jjordao's user avatar
  • 351
7 votes
Accepted

Magento 2 : How to show all active categories in layered navigation with its sub-categories?

Need to override following model : Magento\CatalogSearch\Model\Layer\Filter\Category Override by creating new Module and in di.xml file by following way : <preference for="Magento\CatalogSearch\...
Nitesh Kuyate's user avatar
6 votes

Layered navigation for custom collection on custom page - magento2

I was able to achieve the navigation with below changes, I might not be fully correct with this solution so comments and suggestions are most welcome. 1) Prepare di.xml for frontend section as ...
mp196's user avatar
  • 602
6 votes

Attribute not shown in layer navigation after Migration

The steps to resolve this issue after migrating is first to open the attribute and save it again, this will set the type from text to varchar. After this run the SQL below to copy all data from the ...
Dennis van der Graaf's user avatar
6 votes

Negative price filter in layered navigation

Configurable products have redundant prices that cause wrong configurable min_price calculation. To see the count of all configurable products prices records from the database: SELECT count(*) FROM ...
verheesj's user avatar
  • 171
6 votes

Remove Categories from Layered Navigation - Magento 2

Checked with M2.4.1. There is a configuration here Store -> Configuration -> Catalog -> Catalog
Daniel Vu's user avatar
  • 101
6 votes
Accepted

How to add swatch data in Layered navigation aggregations in graphql?

I have override aggregations GraphQL API. Below code is working for me File:-Custom/Module/registration.php use Magento\Framework\Component\ComponentRegistrar; ComponentRegistrar::register( ...
Devidas's user avatar
  • 3,358
5 votes

Hide out of stock products in Layered Navigation

The "Display Out of Stock Products" option set to No will hide products that are completely out of stock. If you want these to be displayed, but also want filters to hide options where the simple ...
Robert Egginton's user avatar
5 votes
Accepted

Moving layered navigation below product toolbar in layout.xml

The solution i came up with is as follows: <move element="catalog.leftnav" destination="category.product.list.additional" before="-"/>
Sophie Baxter's user avatar
5 votes

magento 2 : Remove catalog.leftnav from non anchored category page

i know this post is old, but i found a simple solution. go to Backend > Products > Categories chose the category you want to remove catalog.leftnav from then go to Design tab, inside Layout ...
Moneef Alnahdi's user avatar
5 votes

Remove Layered navigation - Magento 2

You can do this by just admin category settings. In admin panel of your Magento, go to Products > Categories, then select the category on the left. Now on the right side, select Display Settings ...
Anil Suthar's user avatar
  • 4,731
5 votes
Accepted

Layered Navigation not working with multi-select attributes

Well, turns out this behavior is a feature, not a bug. In the multiselect attribute's Storefront Properties is a setting "Use in Layered Navigation". Two two choices cause the attribute to be used ...
gwideman's user avatar
  • 515
5 votes

How to enable or add layered navigation to search result page in Magento 2

It's tied to the attribute settings: If you need show layered navigation for some attribute then please enable it in backend. Go to stores > attributes > product, find and open needed attribute ...
thdoan's user avatar
  • 728
5 votes
Accepted

Attribute not shown in layer navigation after Migration

In my case migrated multi-select attribute has invalid backend_type value as text, it should be varchar for multiple select After changing backend_type from text to varchar, it's working.
Bilal Usean's user avatar
5 votes
Accepted

Magento 2, get Min and Max price in Layered Navigation

you can get min and max price from any collection For any collection. $maxPrice = $productCollection->getMaxPrice(); $minPrice = $productCollection->getMinPrice(); Layer collection. Follow ...
Qaisar Satti's user avatar
  • 32.5k
5 votes
Accepted

Magento 2 Where (code) are the filters from the layered navigation applied to the product collection?

I found the answer for this. (I think) While it makes sense at some level. The flow is kinda messed up. Here it goes: As I stated in my question the collection used to display the products is a ...
vitoriodachef's user avatar
5 votes

Magento 2: Layered Navigation Price Filter Not Working After Applied Custom Product Discount

This is not a solution, but it may be an explanation of how the price filters work. This might help identify a solution. The prices displayed in the list of products come from the ...
Marius's user avatar
  • 198k
5 votes
Accepted

Display out of stock product only for specific Category in Magento2

To do above things, you need to do this things. Vendor\Extension\etc\di.xml <type name="Magento\CatalogInventory\Helper\Stock"> <plugin name="Vendor_Extension_Stock_Helper" type=...
Dhiren Vasoya's user avatar
4 votes

Magento 2 - How to rearrange Customer "My Account" links

For rearrange or change account link label override customer_account.xml into your theme or existing custom module. in theme ... app/design/frontend/{{vendor}}/{{theme}}/Magento_Customer/layout/...
S.P's user avatar
  • 1,544
4 votes

Magento 2 - How to rearrange Customer "My Account" links

I know this is an old post but you can change the order by changing the number here in the XML's <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:...
Scott's user avatar
  • 41
4 votes

Magento 2 - How to rearrange Customer "My Account" links

We can rearrange these links by using "move". Reference to Magento document for more detail. Assume that you are working on customer_account.xml on your theme. In my case: File path: ...
De Nguyen's user avatar
  • 401
4 votes

Magento 2 layered navigation with checkbox with multi select

I would recommend you to go with smile elastic search suite which comes with many more extra features including multi-select layered nav. It is free and open source :-) I am using this in one of my ...
B G Kavinga's user avatar
  • 1,266
4 votes
Accepted

Magento2: Override layered navigation template

Your xml tags should look like this: <referenceBlock name="block.name"> <action method="setTemplate"> <argument name="template" xsi:type="string">...
Aaron Allen's user avatar
  • 9,009
4 votes

How to retrieve which layered navigation filters are applied in product list page in Magento 2?

You can do this with the layer resolver (Magento\Catalog\Model\Layer\Resolver). Example code: public function __construct( \Magento\Catalog\Model\Layer\Resolver $layerResolver ) { $this->...
Giel Berkers's user avatar
  • 12.3k

Only top scored, non community-wiki answers of a minimum length are eligible