Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / howto force user to select at least one attribute?

howto force user to select at least one attribute?

Locked

Views: 4,108

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
9 May 2006, 9:56 PM
#1
svenschaetzl avatar

svenschaetzl

New Zenner

Join Date:
Jul 2005
Posts:
31
Plugin Contributions:
0

howto force user to select at least one attribute?

Hi,

I´ve realized the tracks for a music album as attribute-checkboxes.

Works fine...

The only problem is, that it happens quite a lot of times, that customers don´t realise that they have to check something before they can click the "add to cart"-button...
=> as product is priced by attributes, this adds the name of the album to the shopping cart with 0.00 EUR...
(perhaps at first the customers are happy about the free product, but after paiement this changes to frustration because there is no download-link ;-)

The very simplest way is to check a "default attribute", in my example a "default track"... But this is not very useful in general...

So how can I say "customer has to check at least one of the attributes, before the products is added to the shopping cart" ?

Any help would be very appreciated...

Bye
Sven

9 May 2006, 9:57 PM
#2
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: howto force user to select at least one attribute?

You could just put a bright red text that says CHECKMARK YOUR SELECTIONS

9 May 2006, 10:13 PM
#3
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Re: howto force user to select at least one attribute?

Make your first value something like "Select from below" and set the Attribute flags as :

Used ForDisplay Purposes Only: YES
Default Attribute to be Marked Selected: YES

If they don't make a choice, they get an error message

10 May 2006, 9:59 AM
#5
ryk avatar

ryk

Totally Zenned

Join Date:
Oct 2004
Location:
Southport, UK
Posts:
3,644
Plugin Contributions:
6

Re: howto force user to select at least one attribute?

Not at the moment - page gives a parse error

15 May 2006, 6:43 AM
#6
svenschaetzl avatar

svenschaetzl

New Zenner

Join Date:
Jul 2005
Posts:
31
Plugin Contributions:
0

Re: howto force user to select at least one attribute?

thank you ryth,

for your good proposition...

But it gives only a warning,
doesn´t prevent the product from beeing added to the basket ;-(

Seems like I will have to modify the code again ;-)

Thank you...
Sven

18 May 2006, 11:39 AM
#7
davale avatar

davale

Zen Follower

Join Date:
Apr 2006
Posts:
117
Plugin Contributions:
0

Re: howto force user to select at least one attribute?

Svenschaetzl, if you succeed in getting this to work with your code rewrite would you be so kind to share it with us? This is on of the things I'm struggling with at the moment and I lack the knowledge of PHP to do it myself. Thanks in advance.

19 May 2006, 7:28 PM
#8
spinner avatar

spinner

New Zenner

Join Date:
Feb 2006
Posts:
39
Plugin Contributions:
0

Re: howto force user to select at least one attribute?

I've got a similar requirement, so I'd be grateful to hear the best solution as well!

Thanks!

19 May 2006, 7:32 PM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: howto force user to select at least one attribute?

A simple method is to make an extra attribute ...

Option Name: Color
Option Values:
Red
Yellow
Green
Select a Color (wording is up to you)

Set the Select a Color as sort order 0 and set as Default and Display Only when adding it ...

This makes it the first on the list ... and by default the selected attribute ...

If the customer tries to add the product with that, it will give an error message to make a proper choice ...

18 Feb 2007, 4:00 PM
#10
marcps avatar

marcps

Zen Follower

Join Date:
Feb 2005
Posts:
92
Plugin Contributions:
0

Re: howto force user to select at least one attribute?

This is great advice and worked well for me.

18 Feb 2007, 4:14 PM
#11
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: howto force user to select at least one attribute?

Thanks for the update ... glad that this solution worked for you ... :smile: