Site maintenance: Sun 15 Nov, from 20:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Setting Up Categories, Products, Attributes / Adjusting the price of an Atribute in Batch

Adjusting the price of an Atribute in Batch

Locked

Started by mdegeiso on 20 Jul 2007, 7:01 PM · Views: 2,486

Results 1 to 17 of 17
This thread is locked. New replies are disabled.
20 Jul 2007, 7:01 PM
#1
mdegeiso avatar

mdegeiso

New Zenner

Join Date:
Mar 2007
Posts:
25
Plugin Contributions:
0

Adjusting the price of an Atribute in Batch

On our site we sell leather clothing. We have placed all the items in the store and priced them using one set price for each product. We have size attibutes from Small to 10 XL and would like to increase the price of the sizes of 5 XL to 10 XL by $20.00 since that is what we are charged. Is there any way I can do this in a batch mode by the size? (ie Make all 5 XL's + $20.00)

Thanks
Mike

20 Jul 2007, 9:09 PM
#2
sanguisdesign avatar

sanguisdesign

Inactive

Join Date:
May 2005
Location:
Western MA, USA
Posts:
588
Plugin Contributions:
1

Re: Adjusting the price of an Atribute in Batch

I did this the other day for a client,
got to Admin -> Catagories/Products -> Option value Manager, and get the id of the XL value from the far left column.
In the below code replace YOUR_PRODUCTS_VAULE_ID w/ the id that you got.
got to admin-> tools -> install sql patches. and run the statement that you just made
be sure to backup you sql before doing this but you can run

UPDATE `products_attributes` SET `options_values_price` = '20.0000' WHERE options_values_id = "YOUR_PRODUCTS_VAULE_ID";

JOsh Beauregard
Sanguis Development

21 Jul 2007, 12:55 PM
#3
mdegeiso avatar

mdegeiso

New Zenner

Join Date:
Mar 2007
Posts:
25
Plugin Contributions:
0

Re: Adjusting the price of an Atribute in Batch

Thanks for the reply, that worked GREAT!! One other thing I had to do was to run the same script and change the price prefix since all my numbers were coming up as negatives.

For those having this problem I ran:

UPDATE products_attributes SET price_prefix = '+' WHERE options_values_id = "YOUR_PRODUCTS_VAULE_ID";

and substituted "YOUR_PRODUCTS_VAULE_ID" with the actual product ID number from the store (ie '45')

Thanks again

21 Jul 2007, 3:28 PM
#4
sanguisdesign avatar

sanguisdesign

Inactive

Join Date:
May 2005
Location:
Western MA, USA
Posts:
588
Plugin Contributions:
1

Re: Adjusting the price of an Atribute in Batch

oh sorry I had assumed that it was already at positive.

JOsh Beauregard
Sanguis Development

22 Jul 2007, 1:46 PM
#5
mdegeiso avatar

mdegeiso

New Zenner

Join Date:
Mar 2007
Posts:
25
Plugin Contributions:
0

Re: Adjusting the price of an Atribute in Batch

That's okay, I didn't realize it till after I ran the script and for me it was a good execise in working with databases and figuring it all out. I posted what I did for other people who may run into the same problem.

Mike

23 Jul 2007, 4:33 PM
#6
eyefultower avatar

eyefultower

New Zenner

Join Date:
Jul 2007
Posts:
77
Plugin Contributions:
0

Re: Adjusting the price of an Atribute in Batch

sanguisdesign:

I did this the other day for a client,
got to Admin -> Catagories/Products -> Option value Manager, and get the id of the XL value from the far left column.
In the below code replace YOUR_PRODUCTS_VAULE_ID w/ the id that you got.
got to admin-> tools -> install sql patches. and run the statement that you just made
be sure to backup you sql before doing this but you can run

UPDATE products_attributes SET options_values_price = '20.0000' WHERE options_values_id = "YOUR_PRODUCTS_VAULE_ID";


Thanks, that was great.

Could something similar be done for sort order?

Many thanks,
Rick
23 Jul 2007, 4:41 PM
#7
sanguisdesign avatar

sanguisdesign

Inactive

Join Date:
May 2005
Location:
Western MA, USA
Posts:
588
Plugin Contributions:
1

Re: Adjusting the price of an Atribute in Batch

EyefulTower:

Could something similar be done for sort order?
Many thanks,
Rick
Yeap sql scrptings is great for bulk updates

JOsh Beauregard
Sanguis Development

23 Jul 2007, 4:53 PM
#8
eyefultower avatar

eyefultower

New Zenner

Join Date:
Jul 2007
Posts:
77
Plugin Contributions:
0

Re: Adjusting the price of an Atribute in Batch

sanguisdesign:

Yeap sql scrptings is great for bulk updates

What is the label for sort order? I haven't looked in the database yet.

would it be too simple to assume its the following?

UPDATE products_attributes SET options_values_sort_order = '20.0000' WHERE options_values_id = "YOUR_PRODUCTS_VAULE_ID";

23 Jul 2007, 5:05 PM
#9
sanguisdesign avatar

sanguisdesign

Inactive

Join Date:
May 2005
Location:
Western MA, USA
Posts:
588
Plugin Contributions:
1

Re: Adjusting the price of an Atribute in Batch

well if you know how to look it it up I would suggest that you look it up. the best way to get comfortable w/ Mysql is to use it.

JOsh Beauregard
Sanguis Development

23 Jul 2007, 5:14 PM
#10
eyefultower avatar

eyefultower

New Zenner

Join Date:
Jul 2007
Posts:
77
Plugin Contributions:
0

Re: Adjusting the price of an Atribute in Batch

sanguisdesign:

well if you know how to look it it up I would suggest that you look it up. the best way to get comfortable w/ Mysql is to use it.
I haven't got mysql, its on my to do list.

27 Apr 2009, 9:53 PM
#11
jymontoya avatar

jymontoya

New Zenner

Join Date:
Apr 2009
Posts:
54
Plugin Contributions:
0

Re: Adjusting the price of an Atribute in Batch

A blast from the past, but....

Could you tell me how to do this using the Options Name ID instead of the Options Value ID?

29 Apr 2009, 2:48 PM
#12
jymontoya avatar

jymontoya

New Zenner

Join Date:
Apr 2009
Posts:
54
Plugin Contributions:
0

Re: Adjusting the price of an Atribute in Batch

Would this change it to be the options name ID instead of the value id?

UPDATE products_attributes SET options_name_price = '20.0000' WHERE options_name_id = "YOUR_PRODUCTS_VAULE_ID";

29 Apr 2009, 5:57 PM
#13
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Adjusting the price of an Atribute in Batch

Are you trying to change all of the Colors to $20.00, meaning Red Orange, Yellow, Green etc., or just all of the Color Red to $20.00 ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

29 Apr 2009, 6:25 PM
#14
jymontoya avatar

jymontoya

New Zenner

Join Date:
Apr 2009
Posts:
54
Plugin Contributions:
0

Re: Adjusting the price of an Atribute in Batch

Neither. I'm trying to adapt this for our purposes. We need to change the prices of all instances of a particular option. Lets say it has an Option ID of 2. Our options use the default, file, value because they do not have options themselves, but rather represent an add-on product.

So to answer your question, I believe we would be changing all the COLORS or in our case ITEM 1s to $20.00 or whatever price we determine.

29 Apr 2009, 6:32 PM
#15
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Adjusting the price of an Atribute in Batch

The products_attributes table has 3 key fields:
products_id the Product itself
options_id the Option Name ID
options_values_id the Option Value ID

You can update the options_values_price field, the attribute price, based on how you reference this ...

If the Option Name, in your case ITEM, has the options_d of 3 ... then you can use:

UPDATE products_attributes SET options_values_price = 20.00 WHERE options_id = 3;

And all Attributes in the products_attributes table that have the options_id of 3 will have the price set to 20.00, regardless of the options_values_id ...

Be sure to backup your database before trying this ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

30 Apr 2009, 1:32 PM
#16
jymontoya avatar

jymontoya

New Zenner

Join Date:
Apr 2009
Posts:
54
Plugin Contributions:
0

Re: Adjusting the price of an Atribute in Batch

Thank you so much! This is incredibly helpful!

It makes me wonder though why there isn't an option to put a value of 'price' to an option. It sucks having individual prices for options under individual products. How hard would it be to request this feature in the future?

30 Apr 2009, 1:59 PM
#17
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Adjusting the price of an Atribute in Batch

It is on the To Do List ... so one of these days ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!