View Single Post
  #5  
Old 10-17-2011, 08:56 AM
 
Powertrain Powertrain is offline
 

Senior Member
  
Join Date: Mar 2011
Posts: 101
 

Default Re: How to add category dropdown beside search box?

I placed this in sidebar and It works great.

Is there a way to add Manufacturers dropdown select to it as well?

I tried by copying manufacturers code from search_result.tpl but it only works on category pages and search results, on other pages it displays empty list .
Here is the code :
PHP Code:
{capture name=manufacturers_items
                {
section name=mnf loop=$manufacturers}
                  <
option  value="{$manufacturers[mnf].manufacturerid}"{if  $manufacturers[mnf].selected eq 'Y'}  selected="selected"{/if}>{$manufacturers[mnf].manufacturer}</option>
                {/
section}
              {/
capture}

               <
select name="posted_data[manufacturers][]" class="adv-search-select">
                    {
$smarty.capture.manufacturers_items}
                  </
select

I also tried to clone this category code to use manufacturers but nothing shows up here is the second code:

PHP Code:
<select name="posted_data[manufacturers]" class="adv-search-select" style="width:170px;margin:5px;">
        <
option value="">Select Manufacturer</option>
        {foreach 
from=$manufacturers_menu_list item=c}
        <
option value="{$c.manufacturerid}">{$c.manufacturer}</option>
        {/foreach}
        </
select


Am I missing something?
Anyone has a working code to display manufacturers and categories by the search box?

Thanks for your help.
__________________
x-cart 4.4.2 Gold
Reply With Quote