Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

How to add category dropdown beside search box?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-28-2011, 08:27 PM
 
zubair@scei.com.au zubair@scei.com.au is offline
 

Member
  
Join Date: Apr 2011
Posts: 13
 

Default How to add category dropdown beside search box?

i want to add a dropdown menu for categories beside search box on my homepage to filter search based on categories. Pls help.
__________________
X-cart Pro
4.4.3
Clever Filters
Smart Template
Reply With Quote
  #2  
Old 04-29-2011, 03:50 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

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

skin/common_files/customer/search.tpl

After...
Code:
<span class="search">{$lng.lbl_search}:</span>
Insert...
Code:
<select name="posted_data[categoryid]"> <option value="">{$lng.lbl_all}</option> {foreach from=$categories_menu_list item=c} <option value="{$c.categoryid}">{$c.category}</option> {/foreach} </select>
__________________
xcartmods.co.uk
Reply With Quote

The following 3 users thank PhilJ for this useful post:
Cankus (05-17-2011), Learner (08-02-2011), zubair@scei.com.au (05-06-2011)
  #3  
Old 05-01-2011, 02:06 AM
 
zubair@scei.com.au zubair@scei.com.au is offline
 

Member
  
Join Date: Apr 2011
Posts: 13
 

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

above code worked like a charm in regular old 3column skin.
Im using smarty template for 4.4.2.Unable to get the result. Pls suggest me of how to use this code for smarty template.
__________________
X-cart Pro
4.4.3
Clever Filters
Smart Template
Reply With Quote
  #4  
Old 08-02-2011, 03:32 AM
 
Learner Learner is offline
 

X-Adept
  
Join Date: Dec 2008
Posts: 807
 

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

Hi,
Works perfectly in my site..

Thanks Phil
__________________
4.6.1 Platinum


Reply With Quote
  #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
  #6  
Old 09-13-2012, 02:34 AM
 
mekon mekon is offline
 

Senior Member
  
Join Date: Jan 2011
Posts: 180
 

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

Run /cleanup.php ? or un-tick 'cache the menu' in Flyout menu module
__________________
------------------------------------------------

Darren
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:19 PM.

   

 
X-Cart forums © 2001-2020