0
votes

I'm new to magento. I have to use the advanced search in magento, but need to display the products only from a particular category in it inspite of the all products. In short all I need is to display advanced search products only from a single category. I'm using magento 1.7.

Any help will be appreciated. Thanks in advance.

2

2 Answers

1
votes

You can add "Search by Category" in advanced search section of Magento. The step by step guide on implementing it is shown in Magento wiki: http://www.magentocommerce.com/wiki/5_-_modules_and_development/search_and_advanced_search/how_to_add_search_by_category_to_advanced_search

If you don't want to display the options to select category, just display none the select dropdown and by default make your desired category selected. So all the search results from that category will only be displayed.

0
votes

inside the search html FORM you can add a new hidden input called "cat" with the id of the category you want to seach for.

<form action="<?php echo $catalogSearchHelper->getResultUrl() ?>" method="get">
<input id="search"  type="text"   name="q" value=""     />
<input id="cat"     type="hidden" name="cat" value="ID_OF_YOUR_CAT"  /> 
</form>