Zen Cart Logo
Forums / General Questions / Attribute Price Batch Update

Attribute Price Batch Update

Views: 536

Results 1 to 2 of 2
12 Mar 2012, 7:53 PM
#1
jdm719 avatar

jdm719

New Zenner

Join Date:
Jan 2011
Posts:
33
Plugin Contributions:
0

Attribute Price Batch Update

There are closed threads here on this.
They end 2009 as far as I can determine and do not reach this level.

I can use:

UPDATE products_attributes SET options_values_price = 1.0000 where options_id = 2 AND options_values_id = 3 AND options_values_price = 5.0000;

to change size price surcharges site wide.

But I wish to limit the changes to a product category.

The master_categories_id I need is in the products table.

How are the two tables links to create an update like:

UPDATE products_attributes
SET options_values_price = 1.0000
where
options_id = 2 AND options_values_id = 3 AND options_values_price = 5.0000

...

where master_categories_id = 10;

12 Mar 2012, 10:15 PM
#2
jdm719 avatar

jdm719

New Zenner

Join Date:
Jan 2011
Posts:
33
Plugin Contributions:
0

Re: Attribute Price Batch Update

Try this:

UPDATE products_attributes
LEFT JOIN products
ON products_attributes.products_id = products.products_id
SET options_values_price = '3.0000'
WHERE (products_attributes.options_id = 'X' AND products_attributes.options_values_id = 'YY' AND products_attributes.options_values_price = '5.0000')
AND (products.master_categories_id = 'ZZZ');