Hello, We have a store running on version 3.4 and need help with the SQL code to update several thousand products by 10% overall (for everything). Therefore we need to update; Product price Product old price Product special price Product attribute type Price adjustment (where exists) Attribute combinations Overridden price (where exists) Any help is appreciated, Many thanks, James
Hello, We have a store running on version 3.4 and need help with the SQL code to update several thousand products by 10% overall (for everything). Therefore we need to update; Product price Product old price Product special price Product attribute type Price adjustment (where exists) Attribute combinations Overridden price (where exists)
UPDATE ProductAttributeCombination SET OverriddenPrice = OverriddenPrice * 1.1 OUTPUT inserted.Id, deleted.OverriddenPrice, inserted.OverriddenPrice WHERE OverriddenPrice IS NOT NULL
ROLLBACK
That's based on a 3.6 database so check the table and column names before doing it but I think it'll be the same (and change the ROLLBACK to COMMIT once you're happy it's not going to break anything).
Many thanks Pete, That worked brilliant, for V3.4 I just needed to change the table names to include Variant for ProductVariantAttributeValue and ProductVariantAttributeCombination as follows;
UPDATE ProductVariantAttributeCombination SET OverriddenPrice = OverriddenPrice * 1.1 OUTPUT inserted.Id, deleted.OverriddenPrice, inserted.OverriddenPrice WHERE OverriddenPrice IS NOT NULL
COMMIT
If any one needs to update all prices by a set percentage, this works! Thanks again Pete. Best regards, James
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.