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)
-   -   product options validation (https://forum.x-cart.com/showthread.php?t=1218)

snorocket 01-18-2003 08:53 AM

product options validation
 
is there any tutorials of furthur explanations on how to use the product validations option? i can't seem to get it to work properly, anyone have any better examples on how to use this and what it does?, thanks


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

rubberneck 02-04-2003 10:01 AM

confused
 
I am having trouble understanding the product options validation feature too. Did you figure it out?

Someone else have some help?

Is the manual/help section going to be updated soon?

snorocket 02-05-2003 11:43 AM

no luck
 
no matter what i try i can't get it to work, just displays an error on the page and then nothing works at all, does anyone know how this works, i don't beleive this many people have xcart an no one knows how to make the product validation work, rrf we explicit instructions on how to use this feature !!!!

dtherio 02-06-2003 07:08 AM

I haven't seen this option. Where is this option you are referring to?

Dale

snorocket 02-07-2003 04:57 AM

under product options
 
the validation thing is under the product options

Nico van de Putte 02-17-2003 02:04 PM

Hi,

I got this working!

You should have an option list first where you make up your own option class (for instance MEDIA)
Option Text is the displayed text. SELECT MEDIA TYPE:
Option list is the list. Something like: CD-ROM=+0
(option 1 is CD-ROM and will cost +0 of your currency over the default price)

Theproduct options validation can be used to manipulate things based on the selection made in the option list

if (product_option('MEDIA').selectedIndex == 1)
{ alert('You have chose the CD-ROM option'); return true; }

If you have more then one selectable item SELECTEDINDEX will increase by one for every new choice.

Hope this helps?

Nico

snorocket 02-18-2003 11:49 AM

yep
 
Hey Nico,

yep i got it working but i get errors when i change the ==1 part .Does anyone know what this part is suppose to do?

if (product_option('MEDIA').selectedIndex== 1)
{ alert('You have chose the CD-ROM option'); return true; }

i figured it was the option line number chioce. Example, if i had an option COLORS and on line 1 was red, line 2 green, line 3 blue, i figured i could put the validation to look like this

if (product_option('COLORS').selectedIndex == 3)
{ alert('You have chosen Color Blue'); return true; }

so the 'You have chosen Color Blue' would pop-up, but all i get is an error on the page, any clues would be great, Thanks - snorocket

Nico van de Putte 02-18-2003 02:50 PM

Hi,

Do the == 2 and == 3 work? If yes it's probably a Syntax error. Please paste it in the forum so we can check.

Nico

snorocket 02-18-2003 05:22 PM

changing the ==1 to any other number then 1 causes an error and the shopping cart does'nt work then, i'm still poking away at it slowly

Nico van de Putte 02-19-2003 09:54 AM

Stupid question: You DO have THREE color option, do you?

Just checking.... :wink:


All times are GMT -8. The time now is 04:01 AM.

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