Page 1 of 1

How to update option pricing over many products?

Posted: Mon Sep 02, 2013 10:09 pm
by itrends
Hi there.

We have, say, 100 products
Each set of products have many options attached
Say, 30 of those products might have option H with a price modifier of +30
How can we easily change all products with that option to be, say, +35 instead

We have different options and different prices we would want to change.
We are using conditional options so we don't want to DELETE and then RE-ADD the options, we simply want to edit the price of the option, nothing else. No name changes or anything.

Any suggestions would be most welcome. If possible to do with a CSV then even better :)

Cheers

Re: How to update option pricing over many products?

Posted: Wed Sep 04, 2013 1:51 am
by Madness Jason
What version Opencart do you have?

Also, do any other product options have +30 besides the ones you want to be +35 now?

Re: How to update option pricing over many products?

Posted: Wed Sep 04, 2013 12:55 pm
by itrends
There would be instances where other options have the same value or that the same option could have the same value more than once yes.

It can be the latest version of opencart. Or just one version back

Re: How to update option pricing over many products?

Posted: Wed Sep 04, 2013 6:26 pm
by daik01

Re: How to update option pricing over many products?

Posted: Thu Sep 05, 2013 1:06 am
by Madness Jason
itrends wrote:There would be instances where other options have the same value or that the same option could have the same value more than once yes.

It can be the latest version of opencart. Or just one version back
Ah, I see.. the second one wouldn't be a problem but if you run the following, it will globally change any option value that is set to $30 to $35.

Code: Select all

UPDATE product_option_value
SET price = '35.0000'
WHERE price = '30.0000'
The power of MySQL. ;)

Re: How to update option pricing over many products?

Posted: Fri Sep 06, 2013 5:01 pm
by itrends
Thanks. I understand that UPDATE command. However, there are multiple option sets that may have the same prices. I wouldn't want to just impact all prices that are 35 and make them 30. I would only want to impact a specific option set. So just updating the values globally like that wouldn't work.

I suspect I am going to have to do some horrid joins.

Re: How to update option pricing over many products?

Posted: Sat Sep 07, 2013 12:39 am
by Madness Jason
Not exactly, you can do this:

Code: Select all

UPDATE product_option_value
SET price = '35.0000'
WHERE price = '30.0000'
AND product_id IN (X,X,X,X,X,X,etc)
X would be the product id you want to change.

Re: How to update option pricing over many products?

Posted: Mon Sep 09, 2013 5:21 pm
by itrends
That still doesn't solve the issue though. But I appreciate the additional input :)