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

The Code for DropDown menu

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-06-2003, 10:33 AM
 
YuriC YuriC is offline
 

Advanced Member
  
Join Date: Mar 2003
Posts: 66
 

Default 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
Reply With Quote
  #2  
Old 05-06-2003, 03:46 PM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #3  
Old 09-04-2003, 04:51 AM
 
sabrina sabrina is offline
 

Advanced Member
  
Join Date: Feb 2003
Location: Indianapolis, IN., USA
Posts: 53
 

Default Drop Down Menu

Tell me please where i have to put this codes and how?
Reply With Quote
  #4  
Old 12-26-2004, 02:18 PM
 
shwekhaw shwekhaw is offline
 

Senior Member
  
Join Date: Nov 2004
Posts: 148
 

Default

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
__________________
X-Cart Gold Plus 4.5.5
Checkout ONE
Checkout ONE DPM
BCSE CIM
Apache
Linux
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 10:38 PM.

   

 
X-Cart forums © 2001-2020