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

Requiring options when adding to cart

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-29-2007, 02:53 PM
 
sccr410 sccr410 is offline
 

Member
  
Join Date: May 2007
Posts: 16
 

Default Requiring options when adding to cart

How do you require someone select an option? By default, it selects the first option - but I don't want that. I want someone to have to look through the options and select one to minimize the amount of returns (selecting size, for example). Too many people just add to cart without thinking about the size they need and I have to deal with too many returns.
__________________
v 4.1.7
Reply With Quote
  #2  
Old 05-29-2007, 03:26 PM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,470
 

Default Re: Requiring options when adding to cart

Hello sccr410,

I guess you're using the latest version of x-cart v4.1.7?

You need to be looking at the 'Validation script (Javascript)' section of the product options section.

Page 447 of the latest x-cart manual will give you more information.

Regards

Shafiq :sK
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
  #3  
Old 05-29-2007, 03:55 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Requiring options when adding to cart

Welcome to X-Cart! Please start by reading the following thread, which will help you get started and hopefully make your experience here a positive one:

http://forum.x-cart.com/showthread.php?t=23970

Please note that this link is not an answer to your question, but we need you to update your signature with your X-Cart version so that we can answer your question correctly. Thanks!
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #4  
Old 05-29-2007, 03:57 PM
 
sccr410 sccr410 is offline
 

Member
  
Join Date: May 2007
Posts: 16
 

Default Re: Requiring options when adding to cart

Yes, using the latest version of X-Cart.

That doesn't really apply, I don't want to validate combinations of options selected. I just want to force users to make a selection. Have the drop down menus start with a blank entry and then have an error popup if the selected values are empty. This will be for every single product, not just a few. I don't want to have to keep copying/pasting the code into every product, I want it to be a part of every product.
__________________
v 4.1.7
Reply With Quote
  #5  
Old 05-29-2007, 04:07 PM
 
sccr410 sccr410 is offline
 

Member
  
Join Date: May 2007
Posts: 16
 

Default Re: Requiring options when adding to cart

That method did work and I suppose will be the only way to really do this. Thanks for the help.
__________________
v 4.1.7
Reply With Quote
  #6  
Old 05-29-2007, 04:19 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Requiring options when adding to cart

Could you take a moment to update your signature per the link I posted? Thank you
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #7  
Old 06-01-2007, 11:55 AM
 
davide101 davide101 is offline
 

Member
  
Join Date: May 2007
Posts: 10
 

Default Re: Requiring options when adding to cart

I would like to second this question. What is the best way to make sure that Product Options default to *nothing* selected so that a user is forced to make a selection. I'm testing my site, showing it to other people, and already found myself adding products to the cart without looking at some of the options. If I make the mistake, I'm sure many others will.
__________________
X-Cart 4.1.7
Reply With Quote
  #8  
Old 09-11-2007, 10:41 AM
 
creativearc creativearc is offline
 

Advanced Member
  
Join Date: May 2007
Posts: 34
 

Default Re: Requiring options when adding to cart

davide101,

It is quite simple. If you are using "Product Variants" to select a color of a product, add a "Select One..." or something to this list and have it displayed first. Then in your Javascript Validation, do something like this:

Code:
var value = product_option_value("color"); if (value == 'Select One...') { alert("Please select the color"); return false; }
__________________
CreativeArc
---------------
X-Cart Pro
Version: 4.1.8
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 05:41 AM.

   

 
X-Cart forums © 2001-2020