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)
-   -   drop down box for manufacturers? (https://forum.x-cart.com/showthread.php?t=43207)

crazyoval 10-24-2008 01:33 AM

drop down box for manufacturers?
 
Hi guys, I have a growing list of manufacturers so I have reduced the clutter on my top page by enabling a single link on the top page to the manufacturers page.

Instead I would like to have a drop down box where a customer can choose the manufacturer they want from the top page.

Does anyone know how to do this? is it straight forward?

Thanks

PhilJ 10-24-2008 05:23 AM

Re: drop down box for manufacturers?
 
Code:

<form method="get" action="manufacturers.php">
<select style="width:100%;" name="manufacturerid" onchange="this.form.submit()">
<option value="0" selected>{$lng.lbl_manufacturers}...</option>
{section name=mid loop=$manufacturers_menu}
<option value="{$manufacturers_menu[mid].manufacturerid}">{$manufacturers_menu[mid].manufacturer}</option>
{/section}
</select>
</form>


JWait 10-25-2008 04:43 AM

Re: drop down box for manufacturers?
 
Depending how many manufacturers you have even a drop down box may not be the answer. We use a scroll box instead. Here is our menu_manufacturers.tpl (v4.1.10 but should work for you also). It goes in skin1/modules/Manufacturers/menu_manufacturers.tpl
Code:

{* $Id: menu_manufacturers.tpl,v 1.1.2.7 2008/04/17 05:45:57 max Exp $ *}
{if $manufacturers_menu ne ''}
{capture name=menu}
<form name="form_manuf" method="get" action="manufacturers.php">
<select size="12" name="manufacturerid" onchange="document.form_manuf.submit()">
{section name=mid loop=$manufacturers_menu}
<option value="{$manufacturers_menu[mid].manufacturerid}">{$manufacturers_menu[mid].manufacturer|truncate:18:"...":true}</option>
{/section}
</select>
</form>
{/capture}
{include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_manufacturers menu_content=$smarty.capture.menu}
{/if}


Changing the number in "select size=" will adjust how many manufacturers are displayed at one time, and "truncate:18:"...":true" will adjust the length of the manufacturers name displayed.

crazyoval 10-25-2008 04:08 PM

Re: drop down box for manufacturers?
 
Thanks guys!! :O)


All times are GMT -8. The time now is 06:48 AM.

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