infrangible / m2-catalog-filter-advanced
Lets shoppers select several values of one layered navigation filter at once, shows filter values as tiles, and opens chosen filters when the page loads.
Package info
github.com/infrangible-dev/m2-catalog-filter-advanced
Type:magento2-module
pkg:composer/infrangible/m2-catalog-filter-advanced
Requires
- php: >=8.1
- ext-ctype: *
- infrangible/m2-foundation: ~3.0.2
- magento/framework: ~103.0.6
- magento/module-catalog: ~104.0.6
- magento/module-catalog-search: ~102.0.6
- magento/module-config: ~101.2.6
- magento/module-eav: ~102.1.6
- magento/module-elasticsearch: ~101.0.6
- magento/module-layered-navigation: ~100.4.6
- magento/module-theme: ~101.1.6
Requires (Dev)
- infrangible/phpstan-magento: ~1.2.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
More ways to show the filters of the layered navigation: shoppers can select several values of one filter at once, values can be shown as tiles, and chosen filters show their values right when the page opens.
Usage
The tab Storefront Properties of a product attribute (Stores > Attributes > Product) gets two fields below Position:
- Display Type in Layered Navigation
- Single Select: Magento's display, a list of links; selecting a value filters the product list by it and hides the filter.
- Multi Select: a list with check boxes; shoppers can select several values, and products with any of them are shown (for example red or blue shirts). The filter stays visible, and the counts next to its values show how many products match each value together with the other filters. Selected values stay in the list, also when another filter leaves no products with them, so that they can be deselected there.
- Single Tile: like Single Select, with the values shown as tiles side by side.
- Multi Tile: like Multi Select, with the values shown as tiles; selected tiles are highlighted.
- Expanded in Layered Navigation: shows the values of the filter when the page opens, instead of only its name. Filters with Multi Select or Multi Tile open by themselves while values are selected in them.
Each selected value is listed in Now Shopping by and can be removed on its own. The selected values are part of
the URL, e.g. ?color=50,53, so filtered pages can be bookmarked and shared.
Behavior
- The display types apply to attributes with the input type Dropdown or Multiple Select. Swatch attributes keep Magento's swatch display, price and other attributes Magento's list.
- Several values of one filter are combined with "or", different filters with "and", as in Magento.
- For a filter with selected values, the store makes one additional search to count its values; the other filters are counted as usual.
- Expanded in Layered Navigation changes the accordion of the filters in the Luma theme (and themes based on it): the chosen filters start open, and several filters can be open at once. Themes that show all filters open, like Blank, are not changed.
- The check boxes use the border and link colors of the theme. The tiles look like the text swatches of configurable products (e.g. sizes), with the outline in the active color of the theme for selected tiles.
- Works on category pages and search result pages.
Requirements
- Magento Open Source or Adobe Commerce 2.4.6 or newer, with OpenSearch or Elasticsearch
- PHP 8.1 or newer
Installation
composer require infrangible/m2-catalog-filter-advanced bin/magento module:enable Infrangible_CatalogFilterAdvanced bin/magento setup:upgrade
In production mode, also run bin/magento setup:di:compile and bin/magento setup:static-content:deploy.
License
Infrangible Catalog Filter Advanced is licensed under the MIT License - see the LICENSE file for details.