I have over 2000 products.
Is there an easy way to set the default attribute on all of them to option_values_id 138?
I have over 2000 products.
Is there an easy way to set the default attribute on all of them to option_values_id 138?
BACKUP First. Make sure it is a valid backup. Then:
This will result in all instances of option_values_id 138 being set to the default.Code:UPDATE products_attributes SET attributes_default = 1 WHERE options_values_id = 138
NOTE: if you already have some option values other than 138 that are defaults, you will need to remove those first. You can do a sort in PHPmyADmin to find them and fix them before running the update.
Last edited by dbltoe; 26 May 2021 at 08:51 PM.
Are You Vulnerable for an Accessibility Lawsuit?
myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
Free SSL, Domain, and MagicThumb with semi-annual and longer hosting.
Removal of the others as default while a good idea is not required as a rule. There are factors associated such as if the option name is a checkbox type, then it depends on the final desired result. There are some earlier sub-versions of 1.5.7 where it may be necessary.
There's also the ability to copy option values available in the products->option values manager at the bottom of the screen.
Then there is the question of how often is something like this going to be necessary and if you might need to develop some sort of process or use another tool.
Some other considerations when setting this default is whether the default is selectable for purchase. If not, then need to also set the display only flag as well and would suggest setting the sort order to 0, though that last is not required to prevent adding the attribute as display only and default.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Bookmarks