...

View Full Version : help with option



ixbiosxi
01-28-2003, 08:54 PM
im trying to add ifs to a shopping cart. basically what i want is if a certain option is picked then i want it to be able to show or not show another option.

say i have 25 colors and they are available in 10 different sizes but only 10 colors are available in the last five of those sizes.

example i have:
if (product_option('Cover').selectedIndex == 1)
{ alert('You have chosen Hard cover for this product'); return true; }

how do you say:
if product_option'whatcolor' then show sizes 1-10
if product_option'othercolor' then hide sizes 5-10

can anyone help me with this?

mordred
01-28-2003, 10:35 PM
You need the if-else control structures:
http://www.php.net/manual/en/control-structures.php#control-structures.if
http://www.php.net/manual/en/control-structures.else.php

and the section on logical operators too
http://www.php.net/manual/en/language.operators.comparison.php

and then it's done in an instant.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum