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)
-   -   Mandatory Product Options Selection (https://forum.x-cart.com/showthread.php?t=28181)

dillion 01-19-2007 03:42 PM

Mandatory Product Options Selection
 
Is it possible to make certian Product Options Mandatory before a customer can add a product to the cart?

nfc5382 01-20-2007 01:32 PM

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.

doersam@hotmail.com 01-20-2007 04:17 PM

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?

nfc5382 01-20-2007 05:44 PM

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.....

dillion 01-21-2007 07:12 AM

Re: Mandatory Product Options Selection
 
Great - This helps me out alot. Thank you for the quick reply.

doersam@hotmail.com 01-21-2007 09:26 AM

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.

dillion 01-21-2007 05:12 PM

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?


All times are GMT -8. The time now is 01:55 PM.

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