View Single Post
  #1  
Old 01-05-2010, 07:44 PM
 
ricardomz ricardomz is offline
 

Senior Member
  
Join Date: Jun 2007
Posts: 111
 

Default Product Options Dropdown Validation onChange

Hello friends

I have a store with a few products (ladders), each ladder has a unique configuration, if you want please see this:

http://www.peldanos.com/portal/product.php?productid=1&cat=0&bestseller=Y

If you see I have 3 product options, for example:
Option 1:
a
b
c
d

Option 2:
a
b
c
d

Option 3:
a
b
c
d
What I need is that the only configurations avilable are: "aaa", "bbb","ccc" and "ddd" I mean, if the user in the Option 1 select "a" then the Option 2, the Option 3 change to "a" also...

I think I could modify it with javascript, and I have some ideas but I don╢t know exactly how to apply this in X-Cart.. but, I have also see that if I change the template customer_options.tpl I can achieve this in all the store but I don't know exactly how to do it.. could some body helpme???

I think if I can set a function in "onChange" of each option and set something like this??.. I don't know??

Code:
<script language="javascript"> function check_options(select) { {foreach from=$product_options item=v} var {$v.class} = document.getElementById('po{$v.classid}'); {/foreach} switch(select) { case 1: switch({$v.class}.value) { case '2': {$v.class}.value = '{$o.optionid}'; {$v.class}.value = '{$o.optionid}'; break; } } } </script>


PLEASE, I REALLY NEED HELP !

THANKYOU!!
__________________
X-Cart 4.5.5
Litecommerce Version: 2.2.45
MИxico
Reply With Quote