I am able to enable 'Layered Navigation' on Catalog Search Result-Page "http://127.0.0.1/catalogsearch/result/index/" (see image below) by just enabling the storefront properties 'Use in Search Results Layered Navigation' of my two attributes.
How can I enable same 'Layered Navigation' also on Catalog Search ADVANCED Result-Page "http://127.0.0.1/catalogsearch/advanced/result/" ?
ps: I have tried the solution from "Magento 2 Layered Navigation in Advance Search Result" but it gives me an error:
- My Catalog Search ADVANCED Result-Page looks now (after trying above solution) like this:
As you can see the layered navigation price-filter shows all items from inventory, instead of just the 4 items that were found as result (see arrows).
- When I click on a price-filter option like '€0.00 – €999.99 (5)', Magento displays an error:
Best Answer
When ever your try to filter product based on price using advanced search form this sent header value like
Price value goes to array form like
from
andto
.But, if you try to filter layered navigation its goes to string not a array like
from
andto
-10000
means price0-10000
10000-
means price10000- above
.I tried Below Solution its works fine.
Override this Model Class:
vendor/magento/module-catalog-search/Model/Advanced.php
.Create di.xml file with in directory
app/code/Vendor/Module/etc/di.xml
.di.xml
Then Create Advanced.php in with in
app/code/Vendor/Module/Model/Rewrite/Advanced.php
Advanced.php
With in the Price Section, I have change like this.
Then, Clear cache and Check it let me know if you have issue.