1

I want to add a search box to my home page. All the products in the catalog have an attribute called "compatible devices". User should be able to select their compatible device from a dropdown list and when hit search, the result should display all the products that have the the selected device as their value for "compatible device" attribute. The form should have no other search field. Can someone please suggest a suitable way to achieve this.

2

Change your "Compatible Devices" attribute to:

Use in Advanced Search: Yes

Then create your own search template. The post action would then post to the catalogsearch/advanced/result page, and the method would be GET

Don't hardcode your dropdown for your available compatible devices, you can get the available options by running:

 $attribute = Mage::getSingleton('eav/config')->getAttribute('catalog_product', 'YOUR ATTRIBUTE CODE HERE');
 $options = $attribute->getSource()->getAllOptions(false);

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.