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'.
|rtownley 90dee6cb5f Merge branch 'master' of advcha/Magento_2_Module_Custom_CMS_Page_with_Layered_Navigation into master||9 months ago|
|RTownley||1 year ago|
|LICENSE.md||1 year ago|
|README.md||1 year 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.
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.