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

product options validation

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-18-2003, 08:53 AM
 
snorocket snorocket is offline
 

X-Adept
  
Join Date: Dec 2002
Posts: 403
 

Default 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; }
Reply With Quote
  #2  
Old 02-04-2003, 10:01 AM
  rubberneck's Avatar 
rubberneck rubberneck is offline
 

Senior Member
  
Join Date: Feb 2003
Posts: 161
 

Default 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?
Reply With Quote
  #3  
Old 02-05-2003, 11:43 AM
 
snorocket snorocket is offline
 

X-Adept
  
Join Date: Dec 2002
Posts: 403
 

Default 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 !!!!
Reply With Quote
  #4  
Old 02-06-2003, 07:08 AM
 
dtherio dtherio is offline
 

Advanced Member
  
Join Date: Jan 2003
Location: Dallas, Texas
Posts: 84
 

Default

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

Dale
__________________
--
X-Cart 4.2, Fancy Categories, Affiliate
Reply With Quote
  #5  
Old 02-07-2003, 04:57 AM
 
snorocket snorocket is offline
 

X-Adept
  
Join Date: Dec 2002
Posts: 403
 

Default under product options

the validation thing is under the product options
Reply With Quote
  #6  
Old 02-17-2003, 02:04 PM
 
Nico van de Putte Nico van de Putte is offline
 

Newbie
  
Join Date: Feb 2003
Posts: 5
 

Default

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
Reply With Quote
  #7  
Old 02-18-2003, 11:49 AM
 
snorocket snorocket is offline
 

X-Adept
  
Join Date: Dec 2002
Posts: 403
 

Default 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
Reply With Quote
  #8  
Old 02-18-2003, 02:50 PM
 
Nico van de Putte Nico van de Putte is offline
 

Newbie
  
Join Date: Feb 2003
Posts: 5
 

Default

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
Reply With Quote
  #9  
Old 02-18-2003, 05:22 PM
 
snorocket snorocket is offline
 

X-Adept
  
Join Date: Dec 2002
Posts: 403
 

Default

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
Reply With Quote
  #10  
Old 02-19-2003, 09:54 AM
 
Nico van de Putte Nico van de Putte is offline
 

Newbie
  
Join Date: Feb 2003
Posts: 5
 

Default

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

Just checking....
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 09:31 AM.

   

 
X-Cart forums © 2001-2020