Forums / Basic Configuration / how can i require a customer to select an attribute?

how can i require a customer to select an attribute?

Locked

Views: 4,847

Results 1 to 15 of 15
This thread is locked. New replies are disabled.
10 Aug 2007, 5:51 AM
#1
mellonade avatar

mellonade

New Zenner

Join Date:
Apr 2007
Posts:
69
Plugin Contributions:
0

how can i require a customer to select an attribute?

Hi all- Ive come across a few postings relating to this, and it seems they all say the only options are to either set a default attribute to be selected, or to create an extra null 'attribute' option like "select from below"... and hope that people will be astute enough to select something.

So, ive gone ahead and created a null attribute option. I'm a bit worried, however, that someone may accidentally forget to choose an option because a) in some cases there are 5+ things to select, and b) my null attribute options all have unique names because I removed the option names from the page and put them as the first option value in each dropdown. Since my first/null attribute options are all unique in name, I'm worried customers may accidentally think they've selected one b/c they're not seeing a generic 'select from below'.

So i had a thought. Since all my null attrib options are set to sort order = 0, could one theoretically write a php/javascript error that will recognize when a customer has 'selected' something with attrib sort order =0 upon pushing the 'add to cart' button? I dont actually know how to do this, but if this is doable, and if anyone might know how, I'd be eternally grateful.. :smile:

10 Aug 2007, 8:04 AM
#2
tophand avatar

tophand

Totally Zenned

Join Date:
Jan 2007
Location:
1.5 miles from Home
Posts:
674
Plugin Contributions:
0

Re: how can i require a customer to select an attribute?

It is already done in Zen-Cart.
All you have to do is set the Attribute Flags:--> Used For Display Purposes Only:--> to "YES".
So for me, I have a attribute option called "Colors" I have a Option Value --> "Please Select" -->Sort -->0 and I have the Attribute Flag --> Used For Display Purposes Only:--> set to "YES".
If the customer doesn't make color a selection, but tries to add the product to the shopping cart. The product page will show this error:
Please correct the following:
On the Option for: Select Color You picked an Invalid Selection: Please Select

M

11 Aug 2007, 5:19 PM
#3
mellonade avatar

mellonade

New Zenner

Join Date:
Apr 2007
Posts:
69
Plugin Contributions:
0

Re: how can i require a customer to select an attribute?

Lovely! Thanks for explaining that to me, its going to be a huge help.

11 Aug 2007, 5:45 PM
#4
styledata avatar

styledata

Zen Follower

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

Re: how can i require a customer to select an attribute?

tophand:

It is already done in Zen-Cart.
All you have to do is set the Attribute Flags:--> Used For Display Purposes Only:--> to "YES".
So for me, I have a attribute option called "Colors" I have a Option Value --> "Please Select" -->Sort -->0 and I have the Attribute Flag --> Used For Display Purposes Only:--> set to "YES".
If the customer doesn't make color a selection, but tries to add the product to the shopping cart. The product page will show this error:
Please correct the following:
On the Option for: Select Color You picked an Invalid Selection: Please Select

M

This is exactly what I do, with one more step. I also set the PLEASE SELECT option value to "Default Attribute to be Marked Selected". This way, if they don't make a selection, they will be prompted to do so as in the above example, but it also insures that no other option will be marked by default (which might be the WRONG option)

Give us your best shot!
http://www.photoimprints.com

29 Nov 2008, 6:59 AM
#5
skybluepunk avatar

skybluepunk

New Zenner

Join Date:
Oct 2008
Posts:
28
Plugin Contributions:
0

Re: how can i require a customer to select an attribute?

I find this solution works fine in Firefox, but I'm having problems in IE7.

The 'Please select colour:' attribute isn't shown as selected by default in IE7.

If the customer just clicks 'Add to cart' without selecting a colour, ZenCart allows him to checkout without displaying an error.

Even if the customer DOES select an attribute, it is not passed through to the checkout, and is not displayed on the order.

Also, stock levels are not adjusted.

This only happens in IE7 as far as I can see - everything works as expected in Firefox.

[PS. I am using Stock by Attribute 4.7MULTIADD, so maybe I should post this in that forum too?]

29 Nov 2008, 7:12 AM
#6
gjh42 avatar

gjh42

Black Belt

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

Re: how can i require a customer to select an attribute?

Since I find it hard to believe that this standard Zen Cart function would not work in IE7 (or there would be a lot of threads complaining about it already), it seems likely that there is something about that version of the mod, or something else unique to your site, that is the cause of the reported problem. A link to your site might give some clues.

You are including the step in post #4, right? This was overlooked in the description in post #2.

29 Nov 2008, 11:36 PM
#7
skybluepunk avatar

skybluepunk

New Zenner

Join Date:
Oct 2008
Posts:
28
Plugin Contributions:
0

Re: how can i require a customer to select an attribute?

Hi Glenn,

Thanks for your prompt response (sorry, I forgot to turn on email notifications, so I didn't see it earlier).

Yes, I have the 'Please select colour:' attributes set as Display Only and Default.

I also have the Sort Order set to -1, to get them to the top of the list, because I don't assign a sort order for the real attributes (they are all sort order = 0).

I have tried changing the Sort Order for the 'Please select a colour:' attribute to 0, instead of -1, in case this was the problem, but it didn't seem to make any difference.

My site is https://www.wooladdiction.com.au/shop

Thanks,
Sheila

30 Nov 2008, 12:44 AM
#8
skybluepunk avatar

skybluepunk

New Zenner

Join Date:
Oct 2008
Posts:
28
Plugin Contributions:
0

Re: how can i require a customer to select an attribute?

As a total coincidence, the solution for my problem has just been posted on the Wishpot Wishlist Management support thread

amazeme:

yes - can confirm this problem. works ok in Firefox but IE prevents ability to add to cart.....BUT only if you have the wishpot code included anywhere BEFORE the attributes module code in tpl_product_info_display.php

I have just relocated the Wishpot code, and all appears to be working fine now.

Thanks for your help,
Sheila

30 Nov 2008, 1:00 AM
#9
gjh42 avatar

gjh42

Black Belt

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

Re: how can i require a customer to select an attribute?

The default/display only seems to work in IE6. I can't get IE7 on my computer.

Glad you got it fixed. It sounded like it had to be a less-common mod (or a quirk of mod installation in your case).

9 Dec 2008, 1:00 AM
#10
rgoetz avatar

rgoetz

New Zenner

Join Date:
Aug 2006
Posts:
36
Plugin Contributions:
0

Re: how can i require a customer to select an attribute?

I went ahead and set my attribute flag Display to Yes and it still puts it in the cart without requiring the customer to choose it. Did I need to do something else? I am using v. 1.3.8

9 Dec 2008, 1:20 AM
#11
gjh42 avatar

gjh42

Black Belt

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

Re: how can i require a customer to select an attribute?

You need to make the null attribute Default and Display Only. Are you sure you have done this? A link to your site would help if you need more assistance.

9 Dec 2008, 1:38 AM
#12
rgoetz avatar

rgoetz

New Zenner

Join Date:
Aug 2006
Posts:
36
Plugin Contributions:
0

Re: how can i require a customer to select an attribute?

OK - I created a Please Select and set it as Display only and Default, it comes up and warns when it someone doesn't choose this attribute. The only issue is that it is a checkbox and it shows it selected - any way to remove the check box from this null attribute?

Rhonda

9 Dec 2008, 2:35 AM
#14
rgoetz avatar

rgoetz

New Zenner

Join Date:
Aug 2006
Posts:
36
Plugin Contributions:
0

Re: how can i require a customer to select an attribute?

Ok, I know the issue - the client wanted checkboxes and you can't have multiple choices. Once I switched to radio buttons it was fine.

9 Dec 2008, 4:14 AM
#15
ajeh avatar

ajeh

Oba-san

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

Re: how can i require a customer to select an attribute?

Thanks for the update and for posting the solution of what you did to resolve this ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!