View Single Post
  #2  
Old 03-14-2011, 03:07 AM
  vasilis's Avatar 
vasilis vasilis is offline
 

X-Adept
  
Join Date: Feb 2009
Posts: 761
 

Default Re: Search box with dropdown

The template file responsible for the search box is customer/search.tpl template file:

Code:
<div class="search"> <div class="valign-middle"> <form method="post" action="search.php" name="productsearchform"> <input type="hidden" name="simple_search" value="Y" /> <input type="hidden" name="mode" value="search" /> <input type="hidden" name="posted_data[by_title]" value="Y" /> <input type="hidden" name="posted_data[by_descr]" value="Y" /> <input type="hidden" name="posted_data[by_sku]" value="Y" /> <input type="hidden" name="posted_data[search_in_subcategories]" value="Y" /> <input type="hidden" name="posted_data[including]" value="all" /> {strip} <input type="text" name="posted_data[substring]" class="text{if not $search_prefilled.substring} default-value{/if}" value="{$search_prefilled.substring|default:$lng.lbl_search|escape}" /> {include file="customer/buttons/button.tpl" type="input" style="image"} <a href="search.php" class="search">{$lng.lbl_advanced_search}</a> {/strip} </form> </div> </div>

In red color is the code for the display of the input text control. I guess you could replace the text type input with a select input (or add beside it so you could have both a text input and a drop-down input), something like:

Code:
<select name="posted_data[substring]" class="text{if not $search_prefilled.substring} default-value{/if}" value="{$search_prefilled.substring|default:$lng.lbl_search|escape}" /> <option>option 1</option> <option>option 2</option> <option>option 3</option> .................................. .................................. </select>

I hope, it works out for you...
__________________
Vasilis Vrontisis
X-Cart Development, Maintenance & Customization
https://[URL="http://www.craftforweb.com"]craftforweb.com[/url]
vasilis@craftforweb.com
Reply With Quote