0

Magento 2.3.3

I overrode the advanced search form (/vendor/magento/module-catalog-search/view/frontend/templates/advanced/form.phtml). Now I want to only search a certain category (by id) when the search button is clicked. How can I achieve that?

Thanks!

1

Copy the file

/vendor/magento/module-catalog-search/view/frontend/templates/advanced/form.phtml

To

app/design/Vendor/Theme/Magento_CatalogSearch/templates/advanced/form.phtml

Vendor/Theme is the theme your website is using. once done you should be able to customise the form as you want.

Flush magneto cache either via the admin panel or using the CLI

bin/magento cache:flush
| improve this answer | |
  • That was how to override it, but I need to know how to make it search a certain category only. – EOB Sep 9 at 8:20
  • for that you would need to extend the code to include that sort of filter – Dava Gordon Sep 9 at 18:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.