This is the code for a Magento 2 module that will create a custom CMS page with layered navigation and a custom collection. For this example, the page URL is /onsale/index/display, and the collection is filtered by an attribute called 'onsale'.
|
5 years ago | |
---|---|---|
RTownley | 6 years ago | |
LICENSE.md | 7 years ago | |
README.md | 7 years ago |
This is the code for a Magento 2 module that creates a custom CMS page with layered navigation.
For this example, the custom page's URL is /onsale/index/display, and it is filtered by the 'onsale' attribute. Modify the Model/Layer.php file to make it use whatever attribute you want.
Known Issues
The Price filter does not display accurate product counts, even though the category filter does. For that reason, we modified the layer/view.phtml page to not display the Price filter.
The filters in the layered navigation module cannot be collapsed.