Post by itrends » Mon Sep 02, 2013 10:09 pm

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

Active Member

Posts

Joined
Tue Jul 14, 2009 7:54 pm

Post by Madness Jason » Wed Sep 04, 2013 1:51 am

What version Opencart do you have?

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

Newbie

Posts

Joined
Wed Aug 22, 2012 7:17 am

Post by itrends » Wed Sep 04, 2013 12:55 pm

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

Active Member

Posts

Joined
Tue Jul 14, 2009 7:54 pm

Active Member

Posts

Joined
Sun Oct 21, 2012 3:18 am


Post by Madness Jason » Thu Sep 05, 2013 1:06 am

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. ;)

Newbie

Posts

Joined
Wed Aug 22, 2012 7:17 am

Post by itrends » Fri Sep 06, 2013 5:01 pm

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.

Active Member

Posts

Joined
Tue Jul 14, 2009 7:54 pm

Post by Madness Jason » Sat Sep 07, 2013 12:39 am

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.

Newbie

Posts

Joined
Wed Aug 22, 2012 7:17 am

Post by itrends » Mon Sep 09, 2013 5:21 pm

That still doesn't solve the issue though. But I appreciate the additional input :)

Active Member

Posts

Joined
Tue Jul 14, 2009 7:54 pm
Who is online

Users browsing this forum: No registered users and 11 guests