changing option value flags in bulk?
We need to alter the attributes on a large quantity of products. Currently the option name "Add" (option ID #22) is set to checkbox and needs to be switched to radio button so customers will be forced to make a selection before they can continue checkout. Once option name "Add" is changed from checkbox to radio button we then add a new option value "Select Quantity" (ID #80) to option name "Add". "Select Quantity" option value can be added to all applicable products using the attributes controller function - Copy to ALL Products where Option Name and Value ....
The sticking point for me is the new option value "Select Quantity" needs to have these flag settings:
Used For Display Purposes Only: yes
Default Attribute to be Marked Selected: yes
Order: 1
Now we need to apply these flag settings to all the products that now have the new option value without having to do that product by product with the attribute controller? Is it possible to do this in the database? The option ID (option name) is #22, option value ID is #80 but there are way to many products to easily know which product IDs would be included. There could be around 2000 products with this option ID. Looking in the database, I'm thinking the recipe would include: products_id, options_id, options_values_id, attributes_display_only, attributes_default. If what I'd like to do is possible I don't know if I've identified all the needed fields or how to construct the sql. Any assistance would be really appreciated.
Re: changing option value flags in bulk?
If the options_values_id = 80 on all of these that you need the Default and Display only turn on, you could then use in the Tools ... Install SQL Patches:
Code:
UPDATE products_attributes SET attributes_default = 1, attributes_display_only = 1 WHERE options_values_id = 80;
Re: changing option value flags in bulk?
Thank you! That worked.......awesome
Re: changing option value flags in bulk?
You are most welcome ... thanks for the update that this was able to work for you ... :smile: