Forums / Setting Up Categories, Products, Attributes / Adding a newly created Option Name/Value to every option menu

Adding a newly created Option Name/Value to every option menu

Views: 2,703

Results 1 to 7 of 7
31 Jan 2014, 1:55 AM
#1
tcarden avatar

tcarden

Zen Follower

Join Date:
Oct 2012
Posts:
282
Plugin Contributions:
0

Adding a newly created Option Name/Value to every option menu

Can someone please explain how to do this:

I've create an option name 'Please Select' and value 'n/a' and want to add to every single product option pull-down menu in the store. Reason being, I have front end code that alerts the user he/she must make a selection before putting the item into their cart.

what is the best way to achieve this?, hopefully quickly

big thanks in advance,

31 Jan 2014, 2:31 AM
#2
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Adding a newly created Option Name/Value to every option menu

You'll need an SQL statement that adds the new value to every product, are you using attributes also?

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

31 Jan 2014, 2:52 AM
#3
ajeh avatar

ajeh

Oba-san

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

Re: Adding a newly created Option Name/Value to every option menu

Do all of these Products already have a set of Option Name and Option Values set?

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!

31 Jan 2014, 3:31 AM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Adding a newly created Option Name/Value to every option menu

You are not quite using this feature correctly ... it is already built in for you on the Attributes ...

What you really want to do to create a forced Option Name/Option Value selection is add your Option Name in the group that you want to force a proper selection the Option Value: Please Select to that Option Name and make it the DEFAULT and set it to DISPLAY ONLY ...

To do this after you added your Attributes, there is a built in feature to add another Option Value to the existing Option Name ...

After you have added Option Names/Values to your Products such as Option Name: Color and Option Value: Red, Yellow and Green ... you could then add to all Products that have Option Name: Color the Option Value for: **Please Select
**
To do this, if you go to the Catalog ... Option Values Manager ... you will see at the bottom of the screen a section headed with the examples:

Copy Option Name/Value to Products with existing Option Name ... |
|

Select an Option Name and Value that currently exists on a product or products to add to all products or to only the products in the selected category that have the selected Option Name.
Example: Add Option Name: Color Option Value: Red to all Products with Option Name: Size
Example: Add Option Name: Color Option Value: Green with default values from Products ID: 34 to all Products with Option Name: Size
Example: Add Option Name: Color Option Value: Green with default values from Products ID: 34 to all Products with Option Name: Size for Categories ID: 65 |

If you pick your Option Name from the dropdown, then the Option Value that matches it for the Please Select

In this example, you would pick the Option Name: Color and the Option Value: Please Select [COLOR] ... in the middle box set Option Name to add to: Color ...

If you want that to all Products that use Option Name: Color just click the INSERT button ...

Next, you need to provide the Option Name value id and the Option Value value id and we can set the defaults for the DEFAULT and DISPLAY ONLY ...

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!

31 Jan 2014, 3:41 AM
#5
ajeh avatar

ajeh

Oba-san

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

Re: Adding a newly created Option Name/Value to every option menu

To set the defaults, say you had the Option Name: Color and its options_id is 1 and your Option Value for the Please Select using the options_values_id is 27 ...

You could update the settings for all of the DEFAULT and DISPLAY ONLY using the SQL code:

UPDATE  products_attributes SET attributes_default = 1, attributes_display_only = 1 WHERE options_id = 1 and options_values_id = 27;

in the Tools ... Install SQL Patches ...

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!

31 Jan 2014, 3:50 AM
#6
ajeh avatar

ajeh

Oba-san

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

Re: Adding a newly created Option Name/Value to every option menu

NOTE: if you want an Option Value like this on ALL of your Option Name/Value groups, you need to add an Option Value for: Please Select to each Option Name that you want this to appear ...

So if you want the Option Name Color to have an Option Value: Please Select and the Option Name: Size to have an Option Value: Please Select you will need to add one to both ...

Then, follow the same concept as posted above to add the Option Values to all Products that use those Option Names and set the DEFAULT and DISPLAY ONLY settings for them as outlined ...

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!

31 Jan 2014, 4:55 AM
#7
tcarden avatar

tcarden

Zen Follower

Join Date:
Oct 2012
Posts:
282
Plugin Contributions:
0

Re: Adding a newly created Option Name/Value to every option menu

great, big thanks for the help.