Layered Navigation for Magento 2

Filters that shoppers actually use: several options per filter with correct counts, swatches, a price slider, Ajax updates and optional readable filter URLs, on Luma and Hyvä.

  • Magento 2.4.6 – 2.4.9
  • PHP 8.2 – 8.5
  • Hyvä and Luma
  • Version 2.0.3
$279

One-off payment, with 12 months of updates.

What is included

  • Install with Composer, or download a zip from your account
  • Licence for one production domain, staging and development copies included

No subscription or automatic renewal. Keep using the versions included in your update period. Update and licence details

Key features

  • Several options per filter (OR) and across filters (AND)
  • Correct counts for the options of a filter in use
  • Checkboxes, swatches, dropdown or price slider per attribute
See all features

Composer package commercegears/module-layered-navigation

  • Shoppers find it faster

    Black or Blue, in size M: shoppers combine options the way they think, and every count shows what is left before they click.

  • Readable filter addresses

    /tops-women/color-black-blue/size-m.html instead of option IDs, with your own words per store view and 301 redirects from the old addresses.

  • Fast and cache-friendly

    Counts come from the search engine, not from per-product queries. Every filtered list is a normal address that the full page cache stores.

All features

What is included

Filtering

  • Several options of one attribute combined with OR
  • Different attributes combined with AND
  • Counts stay correct for a filter already in use
  • Filters on category pages and search results
  • Optional: hide filters that offer only one option

Display

  • Checkboxes, swatches, dropdown or slider per attribute
  • Price slider with from and to boxes, or Magento's price ranges
  • Option order: position, name or number of products
  • Expanded or collapsed on page load per attribute
  • "Show more" link and search box for long lists

SEO

  • Optional friendly filter URLs on category pages
  • One address per combination, other orders redirect (301)
  • Old query-string addresses redirect (301)
  • Slugs per store view, editable in the admin
  • rel="nofollow" on links that combine two or more values

Shopping experience and developers

  • Ajax updates of list, filters and address bar; Back and Forward work
  • Works without JavaScript as plain links
  • Keyboard accessible filters
  • JavaScript event after every Ajax update
  • FilterStateInterface for other modules, CLI to list slugs

Feature tour

Everything your shoppers and your team see

01 / 07

All filters on one sidebar

Selected options appear as chips with a remove link. Colour swatches allow several choices, sizes keep their text swatches and price gets a slider with from and to boxes.

02 / 07

Native on Hyvä

The same filters on Hyvä, styled through Tailwind and run by one small vanilla JavaScript file. No RequireJS, jQuery or Alpine needed for the filters.

03 / 07

Folds behind "Shop By" on phones

On small screens the whole filter block opens from one "Shop By" bar, with the number of active filters in a badge. Luma on the left, Hyvä on the right.

04 / 07

Your words in the address

With SEO-friendly filter URLs on, the German store view of the demo filters to /de/women/tops-women/color-blau-schwarz/size-m.html. Combinations of two or more values get rel="nofollow".

05 / 07

Edit the slug of every option

Pick an attribute and a store view and set your own slug for each option, or leave it empty to use the option label. Slugs are checked before anything is saved.

06 / 07

Display, order and state per filter

On the attribute page: Filter Display, Filter Option Order (position, name or number of products) and Filter Expanded on Page Load.

07 / 07

Short settings page, per store view

Ajax filtering, the "Show more" limit, the search box threshold, hiding single-option filters and SEO-friendly filter URLs.

Live demo

Try it before you install it

A full Magento store with the module installed, on Luma and on Hyvä. The admin demo signs you in with one click.

Compatibility

Requirements and compatibility

Compatibility of Layered Navigation
Magento2.4.6 – 2.4.9
PlatformsMagento Open Source and Adobe Commerce (one price)
Storefront themes Luma Blank Hyvä
PHP8.2 – 8.5
Latest version 2.0.3
composer.json requires php ~8.2.0||~8.3.0||~8.4.0||~8.5.0 magento/framework ~103.0.6 commercegears/module-core ^2.0 free, installed by Composer with this module magento/module-backend * magento/module-catalog * magento/module-catalog-search * magento/module-config * magento/module-eav * magento/module-layered-navigation * magento/module-page-cache * magento/module-store * magento/module-swatches * magento/module-theme * magento/module-url-rewrite *

Installation

Up and running in minutes

After you buy, create a Composer key in your account. Then, in the root of your Magento project:

  1. 01Add the repository and your key (once per project)

    composer config repositories.commercegears composer https://repo.commercegears.com
    composer config --auth http-basic.repo.commercegears.com PUBLIC_KEY PRIVATE_KEY
  2. 02Install the module

    composer require commercegears/module-layered-navigation
  3. 03Enable it

    bin/magento setup:upgrade
    bin/magento setup:di:compile
    bin/magento setup:static-content:deploy
    bin/magento cache:flush

    The last three are only needed in production mode.

Prefer a zip? Every version you are entitled to can be downloaded from My modules. More about Composer access

User guide

Setting up Layered Navigation

The user guide has its own page: how to install Layered Navigation, what each option does and how to use it in your store. Written for version 2.0.3; a copy ships with the module.

In the guide

Read the user guide

Changelog

Release notes

2.0.3

Latest
  • Fix: Add to Cart works on product lists updated by Ajax filtering when the page came from the page cache.
  • Fix: Ajax filtering keeps what other scripts stored in the browser history entry.

2.0.2

  • Improvement: compatible with Magento 2.4.6 (PHP 8.2).

2.0.1

  • Improvement: user guide screenshots and links updated for the CommerceGears name

2.0.0

  • Improvement: renamed to CommerceGears (new Composer package, admin menu and settings paths)

FAQ

Questions, answered

Something else on your mind? The developers who wrote the module answer before and after you buy.

Ask a question →

Already installed it? Open a support ticket

What does it change compared with Magento's own layered navigation?

Shoppers can pick several options in one filter (for example Black or Blue) and combine filters (Black or Blue, in size M). Selected options are shown as "Now shopping by" chips with a remove link, "Clear All" and "Clear <filter>". Each attribute can be shown as checkboxes, swatches, a dropdown or a price slider, long lists get "Show more" and a search box, the list updates without a full page reload, and filtered category pages can have readable addresses.

Are the product counts correct when several options are selected?

Yes. Options of one attribute are combined with OR, so the counts of a filter you are already using are calculated without that filter's own selection ("disjunctive" counts). This costs one extra search request per filtered attribute, at most six per page. All counts come from the search engine (OpenSearch or Elasticsearch); nothing is queried per product.

Does it work with Hyvä?

Yes. The module ships Hyvä layout handles and registers itself for Hyvä's Tailwind build, so the styles are merged into your theme CSS when you rebuild it. The behaviour is one small vanilla JavaScript file shared by Luma and Hyvä, with no RequireJS, jQuery or Alpine needed. It was tested with Hyvä 1.5 and the default theme.

What do the SEO-friendly filter URLs look like?

/women/tops-women.html?color=49,50&size=168 becomes /women/tops-women/color-black-blue/size-m.html. Each attribute gets one path segment, sorted by attribute code, and the options within a segment are sorted alphabetically, so every combination has exactly one address. Other orders and the old query-string addresses answer with a 301 redirect. The setting is off by default and can be switched on per store view.

Can I use my own words in the filter URLs, for example in German?

Yes. Under CommerceGears > Layered Navigation > Filter URL Slugs you pick an attribute and a store view and enter a slug for each option (letters a to z, digits and single hyphens). Empty fields use the store view's option label. The demo's German store view uses German colour slugs such as color-blau-schwarz.

Which filters go into the friendly URL?

Dropdown, multiple select and yes/no attributes on category pages. Price and decimal ranges, the category filter, sorting and paging stay in the query string (for example ?price=20-50&p=2). Search results keep query-string filters.

Can friendly filter URLs clash with products, CMS pages or subcategories?

No. The filter router only answers when the full address is not an existing URL rewrite, so products, CMS pages and real subcategories always win. It also checks that the rest of the path is a category of the store view and that every segment is a valid filter.

Will search engines crawl every filter combination?

Links that combine two or more filter values get rel="nofollow", so crawlers are not sent through every combination; pages with a single filter value stay crawlable. If you use an SEO module for robots and canonical tags, it can read the current filters through the module's FilterStateInterface.

Does Ajax filtering break the full page cache or the Back button?

No. Every filtered list is a normal GET address, so the full page cache stores it like any other page and the list works without JavaScript. With Ajax filtering on, the product list, the filters and the address bar update without a reload, and Back and Forward work.

My theme or another extension runs code on the product list. Does it still work after an Ajax update?

The product column is replaced with the same HTML a normal page load returns, Luma widgets are started again and on Hyvä inline scripts run and Alpine components are initialised. After that the event commercegears:layered-navigation:updated fires on document, so analytics, sliders or lazy loaders can run again.

Is there a stock status or rating filter?

Not in this version. Stock status and ratings are not offered as filters.

What happens to old friendly addresses when I rename an option?

The automatic slug follows the option label, so an address with the old name returns 404. Set a custom slug under Filter URL Slugs to keep an address when you rename an option.

Support

Help from the developers who wrote it

From the blog

Guides and articles