Forums / Setting Up Categories, Products, Attributes / Global changes to Attribute price?

Global changes to Attribute price?

Started by michaelchu on 21 Nov 2011, 7:15 PM · Views: 2,268

Results 1 to 6 of 6
21 Nov 2011, 7:15 PM
#1
michaelchu avatar

michaelchu

Zen Follower

Join Date:
Nov 2011
Posts:
121
Plugin Contributions:
0

Global changes to Attribute price?

I found an old thread where a solution was posted for global changes to attribute image.
Here is the sql patch:

UPDATE products_attributes SET attributes_image = 'attribute_image.jpg' WHERE options_id = XXX and options_values_id = XXX;

What would be the field name used for the attribute price change?
Something like:

UPDATE products_attributes SET attributes_price = 15.00 WHERE options_id = XXX and options_values_id = XXX;

Thank for the help.

21 Nov 2011, 7:27 PM
#2
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Global changes to Attribute price?

The field is called options_values_price .

But what exactly are you trying to do?

You say you are looking to do a GLOBAL update.

If you want to do a GLOBAL update, then you need to establish FIRST, which products have which attributes assigned, and how they are currently priced.

That bit of SQL you mention refers to a SPECIFIC item:

WHERE options_id = XXX and options_values_id = XXX

The XXX will be replaced by the relevant id's.

If you are looking to update MULTIPLE option values, then considerable care is needed

This can be tricky, and I would not advise a novice doing it.

It depends on a few things... do you want to raise prices by a set value - such as by 20%, or does each have a unique value?

20 years a Zencart User

21 Nov 2011, 8:32 PM
#3
michaelchu avatar

michaelchu

Zen Follower

Join Date:
Nov 2011
Posts:
121
Plugin Contributions:
0

Re: Global changes to Attribute price?

Thank you for the response. What I am trying to achieve is the same as the attribute swatch patch but with the attribute price change.
The problem really comes from the fact that I have many products that share the same attributes, but the attribute properties (such as image swatch and prices for individual options) are not transferrable when copying the options from 1 product to another.

I have created an sql patch which will update all the option image swatches after I create/copy now products with their attributes, now I need to do the same for the price changes as well. In the case of the Attribute_image, the field value (image file name) is enclosed in " ", I just need to know if the Option_values_price is of numeric type (00.000) or does it need to be in quotes as well ("00.000")? I would assume it is just standard decimal 00.000 but need it to be sure.

21 Nov 2011, 10:03 PM
#4
michaelchu avatar

michaelchu

Zen Follower

Join Date:
Nov 2011
Posts:
121
Plugin Contributions:
0

Re: Global changes to Attribute price?

Just FYI, thanks for pointing me in the right direction, I was able to setup the option price change along with the attribute image, now I can update all of my attributes in 1 single sql file any time I add new products.

6 Mar 2012, 12:29 PM
#5
alc1967 avatar

alc1967

New Zenner

Join Date:
Nov 2010
Posts:
6
Plugin Contributions:
0

Re: Global changes to Attribute price?

Hi Michael

It would be great if you could post the sql file or fix for this, I am also trying to update an attribute price for multiple products.

18 Dec 2014, 6:44 PM
#6
rumina avatar

rumina

New Zenner

Join Date:
Dec 2014
Location:
Canada
Posts:
2
Plugin Contributions:
0

Re: Global changes to Attribute price?

michaelchu:

Just FYI, thanks for pointing me in the right direction, I was able to setup the option price change along with the attribute image, now I can update all of my attributes in 1 single sql file any time I add new products.

Hi, can you please provide the sql file that you used as I"m not very savvy in those things?