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)
-   -   The Code for DropDown menu (https://forum.x-cart.com/showthread.php?t=2580)

YuriC 05-06-2003 10:33 AM

The Code for DropDown menu
 
Here's the code.. I guess I was in bad mood or something when I wrote my prev. post...

Code:

{* $Id: product_dropdown_list.tpl,v 1.00 04/29/2003 13:23:08 acidleak Exp $ *}
Browse our Products:
<select name="all_products" onChange="window.top.location.href=this.options[this.selectedIndex].value;">
        <option value="">===============></option>
{section name=list loop=$all_products}
<option value="http://www.worldhealthproducts.com/customer/product.php?productid={$all_products[list].productid}">{$all_products[list].product|truncate:25:"...":true}</option>
{/section}
</select>


Put the template included below inside head.tpl as such; change the path accordingly
Code:

<div align="right">{ include file = ../customer/custmods/product_dropdown_list.tpl }</div>

before you'll be able to use the template, you need to build that $all_products array

Code:

# include all copyright info here
# $Id: all_products.php,v 1.24 2002/11/14 07:58:17 acidleak Exp $
#
# Get all products data and store it into $all_products array
#

#
# select from products table
#

$all_products = func_query("select product,productid from $sql_tbl[products] order by $sql_tbl[products].product");
$smarty->assign("all_products",$all_products);
?>


Put the followign line right underheath your "require" calls inside of [b]product.php, products.php, search.php, cart.php [b] changing the path accordingly

Code:

require "./custmods/all_products.php";

Problems? pm me

-acidleak

shan 05-06-2003 03:46 PM

:idea: :wink:

sabrina 09-04-2003 04:51 AM

Drop Down Menu
 
Tell me please where i have to put this codes and how?

shwekhaw 12-26-2004 02:18 PM

I tried the code posted by YuriC.
- I put the dropdown code in categories.tpl and got the dropdown shows up but no entry.
I include all_products.php in customer/categories.php, home.php, products.php etc.
But the content of php code shows up on the top of webpage above logo and everything. But dropdown is still empty.

Could anyone tell me what could I be doing wrong? Or it is version problem? I am using 4.0.7 and I believe YuriC wrote the code long before version 4 came out.

He got it working at
http://worldhealthproducts.com/customer/home.php

Is there anyway I can achieve this in version 4?

Zaw


All times are GMT -8. The time now is 07:29 PM.

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