Sometimes a store needs to filter category or search results by an attribute without offering that attribute as a visible filter to shoppers. Typical examples are campaign links, menu entries or landing pages that point to a pre-filtered product list. In standard Magento an attribute is either shown in layered navigation or it cannot be used for filtering at all. This module adds a third choice: the attribute filters the product list, but it is not displayed.
Features
- New option “Filterable (hidden)” for the “Use in Layered Navigation” setting of product attributes.
- Attributes set to this option work as filters when the filter value is part of the page address (for example in a link to a category page), just like a normal layered navigation filter.
- The attribute does not appear in the layered navigation block on category and search result pages.
- An active hidden filter is also left out of the list of currently applied filters, so shoppers do not see or remove it by accident.
- The new option is also shown in the “Use in Layered Navigation” column of the product attribute grid.
Configuration
There is no separate settings page. Open Stores > Attributes > Product, edit an attribute and choose “Filterable (hidden)” in the “Use in Layered Navigation” field on the Storefront Properties tab. Reindex as usual after changing attribute settings.
Good to know
Filter values are passed in the page address in the same way as standard layered navigation filters, so you can build links to pre-filtered product lists by hand or with other modules, for example the attribute landing pages of “Catalog Attribute Landing Page”.
Installation
Install the module with Composer in your Magento root directory:
composer require infrangible/m2-catalog-attribute-filter-hiddenThen enable it and update the store as described in the installation guide. Composer installs the required modules listed on this page automatically.