X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   How to add category dropdown beside search box? (https://forum.x-cart.com/showthread.php?t=59122)

zubair@scei.com.au 04-28-2011 08:27 PM

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.

PhilJ 04-29-2011 03:50 AM

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>


zubair@scei.com.au 05-01-2011 02:06 AM

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.:D/

Learner 08-02-2011 03:32 AM

Re: How to add category dropdown beside search box?
 
Hi,
Works perfectly in my site..

Thanks Phil

Powertrain 10-17-2011 08:56 AM

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.

mekon 09-13-2012 02:34 AM

Re: How to add category dropdown beside search box?
 
Run /cleanup.php ? or un-tick 'cache the menu' in Flyout menu module


All times are GMT -8. The time now is 07:22 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.