2

I am currently making a Magento 2 store, and have two separate searches; the first one is just a normal query that searches the whole product database. However, it's the second one that I'm having issues with.

I want users to be able to select their animal from a dropdown list and then type in the problem they're experiencing (Horse, and Broken Leg) for example. This will then bring back products that have been selected to appear based off the search term. See image for a better example of what I need to do.

Currently I just have a placeholder CMS block in there that doesn't do anything.

Any advise on how I would go about this is greatly appreciated.

enter image description here

1

Your first drop down could be a product attribute which is immediately applied when you use the search. So basically both methods are using the same search infrastructure. It's just that the first search searches everything whilst the second search immediately has a filter applied.

You would need to go through and add product attribute values for all your products to help limit the result set.

Also I'm assuming this filter needs to be hidden (in the layered navigation) from both searches. In which case potentially hide in CSS. You could experiment with the different product attribute settings in terms of visibility. But you want the filter to work - so I can't say exactly how that will work out for you.

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.