Forums / Templates, Stylesheets, Page Layout / Compulsory Attribute

Compulsory Attribute

Locked

Started by websightdesign on 30 Jan 2008, 1:41 PM · Views: 3,057

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
30 Jan 2008, 1:41 PM
#1
websightdesign avatar

websightdesign

New Zenner

Join Date:
Mar 2006
Posts:
72
Plugin Contributions:
0

Compulsory Attribute

Hi

I am just wondering whether there is an option in zen cart or a modification i can install that will require a customer to select an attribute if there is some before they can add a product to the cart.

Any help would be much appreciated.

Thanks
Brad

30 Jan 2008, 2:40 PM
#2
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Compulsory Attribute

As far as I know, the only type of attribute one can make "required" is a TEXT INPUT attribute. All the others are optional, because the shopper will make a selection of other attributes based on the options you configure. Within these selections, you can set a DEFAULT, so if the shopper fails to "adjust" the option to his/her requirement, the default setting will be automatically added.

So, for example, if you have a dropdown list of options for "buy batteries with this item", you would configure values such as:-

BUY BATTERIES WITH THIS ITEM?
"not required" (no extra cost or weight added)
"pack of 4" (relevant extra cost + weight added)
"pack of 8" (relevant extra cost + weight added)
"pack of 12" (relevant extra cost + weight added)

...and you'd set the default to "not required".

20 years a Zencart User

30 Jan 2008, 4:25 PM
#3
gjh42 avatar

gjh42

Black Belt

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

Re: Compulsory Attribute

What you do is make another option value for the option name, called "Select" or whatever, and add that as an attribute, setting it as Default and Display Only in Attribute Controller.

Then the customer will be required to actively make a choice before adding to cart.

31 Jan 2008, 11:05 AM
#4
websightdesign avatar

websightdesign

New Zenner

Join Date:
Mar 2006
Posts:
72
Plugin Contributions:
0

Re: Compulsory Attribute

Thanks for the quick reply the only problem i have with the method you have suggested is that i have hundreds on option names which have already been entered and it would take me days to get through them all due to the amount of products and attributes are online.

Is there any more ideas that i can try which may resolve the problem with a template alteration in the attribute controller template.

Thanks
Brad

31 Jan 2008, 5:22 PM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: Compulsory Attribute

If you have advanced PHP or maybe javascript coding skills, you could probably write something that would replicate the "required response" function that is already built in with the display only.

Otherwise, you have the answer and will just need to implement it. Check out the option value copying possibilities.

Since you say you have hundreds of different option names, there will not be a nice bulk copy feature, but you can make a new option name with only the Select value, and in Option Names Manager use the "Copy ALL Option Values to another Option Name" function to propagate it faster.
Then I think you will have to add each value in Attributes Controller.

If you have option names which are used by more than one product, then you can bulk copy the new attribute to all other products with that name, in Attributes Controller using "Add ALL Option Values to ALL products for Option Name"
Update ALL existing products that have at least ONE Option Value and Add ALL Option Values in an Option Name.

1 Feb 2008, 5:03 AM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Compulsory Attribute

NOTE: To copy 1 attribute to 1 or more categories where you already have Option Names and want to add 1 more option value you can do this in the Option Value Manager ...

Say you want to add the Color Pink to all Products with the Color Red in categories_id 45 ...

Look in the Option Values Manager and you will see:

Copy to ALL Products where Option Name and Value ...
Select an Option Name and Value that currently exists on a product or products that you then want to copy another Option Name and Value to for all products with this existing Option Name and Value

Pick from the Option Name From: COLOR and Option Value From: RED
Pick from the Option Name To: COLOR and Option Value To: Pink
Pick categories_id 45

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!

6 Feb 2009, 5:49 PM
#7
beeunique avatar

beeunique

New Zenner

Join Date:
Jan 2006
Posts:
51
Plugin Contributions:
0

Re: Compulsory Attribute

gjh42:

What you do is make another option value for the option name, called "Select" or whatever, and add that as an attribute, setting it as Default and Display Only in Attribute Controller.

Then the customer will be required to actively make a choice before adding to cart.

Thanks for this - been trying to sort this for ages.

Also is there any way to make this 'select' or default option invisible i.e. not appear on product listing on website?
(it pushes photo-attribute options onto two lines but would prefer it not to show if possible)