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

Mandatory Product Options Selection

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-19-2007, 03:42 PM
 
dillion dillion is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 53
 

Default Mandatory Product Options Selection

Is it possible to make certian Product Options Mandatory before a customer can add a product to the cart?
__________________
X-CART GOLD 4.1.7
UNIX
Reply With Quote
  #2  
Old 01-20-2007, 01:32 PM
 
nfc5382 nfc5382 is offline
 

X-Adept
  
Join Date: Nov 2002
Posts: 481
 

Default Re: Mandatory Product Options Selection

easy, fill in the validation box for the option. So for a given option named "OPTION", first item "SELECT ONE":

Code:
if (product_option('OPTION').selectedIndex == 0){ alert('Please select product option.'); return false;} else{ return true; }

So if the user doesnt change the option from "SELECT ONE" it will alert them and not allow adding to cart.
__________________
-----------------------
x-cart v4.7.6 [LIVE]
x-cart v4.0.18 [retired 2004-2016]
x-cart v3.5.13 [retired]
x-cart v3.4.14 [retired]
Reply With Quote
  #3  
Old 01-20-2007, 04:17 PM
 
doersam@hotmail.com doersam@hotmail.com is offline
 

Senior Member
  
Join Date: Jul 2004
Location: Snohomish, WA
Posts: 153
 

Default Re: Mandatory Product Options Selection

I have been using this code for a couple of years and it works great, except I discovered a problem. If I enable the Buy Now feature, the customer is not prompted to make any choices - the product gets added to the cart and they can checkout, bypassing the necessary choice. Any suggestions?
__________________
Thanks,
Phil

X-Cart Gold
Version 4.4.5
Reply With Quote
  #4  
Old 01-20-2007, 05:44 PM
 
nfc5382 nfc5382 is offline
 

X-Adept
  
Join Date: Nov 2002
Posts: 481
 

Default Re: Mandatory Product Options Selection

I've disabled the buy it now button. It doesnt make much sense as most of my products have options/colors/sizes so.....
__________________
-----------------------
x-cart v4.7.6 [LIVE]
x-cart v4.0.18 [retired 2004-2016]
x-cart v3.5.13 [retired]
x-cart v3.4.14 [retired]
Reply With Quote
  #5  
Old 01-21-2007, 07:12 AM
 
dillion dillion is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 53
 

Smile Re: Mandatory Product Options Selection

Great - This helps me out alot. Thank you for the quick reply.
__________________
X-CART GOLD 4.1.7
UNIX
Reply With Quote
  #6  
Old 01-21-2007, 09:26 AM
 
doersam@hotmail.com doersam@hotmail.com is offline
 

Senior Member
  
Join Date: Jul 2004
Location: Snohomish, WA
Posts: 153
 

Default Re: Mandatory Product Options Selection

I figured out my problem: In the Product Options Options, I needed to check the "A customer using the "Buy now" button to order a product with product options must be redirected to the product details:" box in addition to the Appearance Options having the "Enable "Buy Now" button in the products list:" box checked.
__________________
Thanks,
Phil

X-Cart Gold
Version 4.4.5
Reply With Quote
  #7  
Old 01-21-2007, 05:12 PM
 
dillion dillion is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 53
 

Default Re: Mandatory Product Options Selection

Question - I have entered the code in the validation box for One of my Options. I have serveral Options that I need to use this code on (for one item). What changes do I need to make to the code so that it will work with multiple Options?
__________________
X-CART GOLD 4.1.7
UNIX
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:15 AM.

   

 
X-Cart forums © 2001-2020