Skip to content

Adding filter attribute to search query?

Magento 2.4

Is there a way to add an attribute to the search query every time a search is triggered?

Example searching for “test”: https://www.example.com/catalogsearch/result/?q=test

I want to add status=41%2C42%2C43%2C45, so that it looks like this in the end:

https://www.example.com/catalogsearch/result/?q=test&status=41%2C42%2C43%2C45

I thought this might not be too hard to do, but I found nothing useful so far. Is it possible, also considering that ther search is done with elasticsearch?

Thanks!