In Magento2.4.x how to hide categories from left side layered navigation on search result page only. Is there any setting/configuration or will have to do through code There is a configuration here Store -> Configuration -> Catalog -> Catalog But not specific to the search result page
1 Answer
you can override this file
vendor/magento/module-catalog-search/view/frontend/layout/catalogsearch_result_index.xml
app/design/frontend/Vendor/Theme/Magento_CatalogSearch/layout/catalogsearch_result_index.xml
and add this code
<referenceContainer name="sidebar.main" remove="true" />
<referenceBlock name="catalogsearch.leftnav" remove="true" />
<referenceContainer name="sidebar.additional" remove="true" />
-
This will remove the whole left sidebar, I want to remove the categories filter only.– ishaqCommented Sep 10, 2021 at 12:11