Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.

Force attribute selection?

Started by jenpen on 21 May 2010, 3:15 AM · Views: 3,746

Results 1 to 11 of 11
21 May 2010, 3:15 AM
#1
jenpen avatar

jenpen

Zen Follower

Join Date:
Sep 2007
Location:
Far South Coast, NSW, Australia
Posts:
427
Plugin Contributions:
0

Post #1 by jenpen

Hiya,
I noticed that it's possible to place items in the cart without first selecting (in my case) colour or size. Is there some way of stopping a customer proceeding until they've made a selection?
Jen

21 May 2010, 9:20 AM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #2 by gjh42

Add another option value to the option name (call it Select, Choose One or whatever you like), and add that as an attribute, marking it as Default and Display Only. This will force an actual choice to be made.

22 May 2010, 2:45 AM
#3
jenpen avatar

jenpen

Zen Follower

Join Date:
Sep 2007
Location:
Far South Coast, NSW, Australia
Posts:
427
Plugin Contributions:
0

Post #3 by jenpen

Great, thanks - but I guess that means setting up this new value for each attribute and each product, one at a time? :wacko:
And how do I make the new value (I called it Select) appear at the top of the list every time? Thanks, Jen

22 May 2010, 3:19 AM
#4
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,190
Plugin Contributions:
0

Post #4 by haredo

Within the attribute controller as you list the attribute values

  1. Under this Heading: Prices and Weights
  2. you will see: price, weight, order, one time
  3. start with 0 for Select
  4. and 1 for the first value
  5. and 2 for the second value

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

22 May 2010, 3:28 AM
#5
jenpen avatar

jenpen

Zen Follower

Join Date:
Sep 2007
Location:
Far South Coast, NSW, Australia
Posts:
427
Plugin Contributions:
0

Post #5 by jenpen

Thanks haredo but a little more detail if possible. I can see Price Weight Order One Time. Do I have to type my values into there somewhere? This has nothing to do with Price or Weight. Not finding this very intuitive, I'm afraid.

22 May 2010, 3:32 AM
#6
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,190
Plugin Contributions:
0

Post #6 by haredo

That is ok...

  1. For the Value called Select under the Order will be 0
  2. For the Value called " " under the Order will be 1
  3. etc, etc
    If, have any more trouble PM me...

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

22 May 2010, 5:14 AM
#8
jenpen avatar

jenpen

Zen Follower

Join Date:
Sep 2007
Location:
Far South Coast, NSW, Australia
Posts:
427
Plugin Contributions:
0

Post #8 by jenpen

Thanks Haredo - please just confirm though: is it possible to add an order to the values after they are set up, or do you have to do it when you're first setting them up? ie do I have to start all over again with every product in my store? I added the order "0" to my pre-existing default option but it didn't do anything.

22 May 2010, 6:14 AM
#9
jenpen avatar

jenpen

Zen Follower

Join Date:
Sep 2007
Location:
Far South Coast, NSW, Australia
Posts:
427
Plugin Contributions:
0

Post #9 by jenpen

And, can I say, this feels like a pretty dodgy workaround for a feature that should be standard, no? I mean, if an item is available in three colours the customer should be forced to choose a colour, shouldn't they? Without adding a fake invalid colour to force an error message. It's the kind of choice I would expect to see in Admin > Configuration > Attribute Settings, eg "Customer cannot add product to cart without selecting attribute (where attributes exist)."

Or do store-owners usually pre-select a default size/colour/whatever for their customers?

27 Jan 2011, 10:30 PM
#10
nathant avatar

nathant

New Zenner

Join Date:
Jun 2009
Posts:
31
Plugin Contributions:
0

Post #10 by nathant

gjh42:

Add another option value to the option name (call it Select, Choose One or whatever you like), and add that as an attribute, marking it as Default and Display Only. This will force an actual choice to be made.

10 points for gjh, that did the trick nicely

27 Jan 2011, 11:18 PM
#11
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #11 by gjh42

Glad it's working for you!

I note jenpen's comment... No, actually, it shouldn't be a global requirement or setting to force a selection for radiobuttons or dropdowns. There are plenty of situations where it is fine for some attributes to remain unselected while others must be selected, and only a per-attribute admin setting could force that. And this wouldn't even cover setting a default message or box/label text the way the ZC method does.
It is also possible to hide the "default" attribute so that it doesn't clutter the page, using CSS on attribute ids, if desired.