I have inherited a WordPress installation with WooCommerce already set up and with about 1,000 products and variations.
I've done some Googling and searching here but haven't found adequate answers to my questions.
Firstly, can anyone guide me to writing a MySQL query to modify all prices based on based on text included in a product name? For example, if the product starts with '123-' change the price to 100.
Secondly, and fairly closely related, is that none of the products have Shipping Classes. I've created the Shipping Classes and would like to update them by a similar method using the same update criteria.
I have absolutely no idea what to search for and replace. When I have looked at the database it doesn't make much sense. I have an export of the database via a free plugin, but that doesn't have the field names the same as the database has them. I do understand from other posts here that products and prices, etc are in the wp_posts table. I've also read on here that I need to update both _price and _regular_price but my database dump only has 'Price' so I don't know if it is _price or _regular_price or both.
Any guidance would be appreciated.
So far the best I can figure would be:
UPDATE wp_posts
SET <Price>,<Regular Price> = 100
WHERE LEFT(<Product Name>,4) LIKE '123-'
UPDATE wp_posts
SET <Shipping Class> = <Class Value>
WHERE LEFT(<Product Name>,4) LIKE '123-'
Unfortunately I also don't know whether to use the Shipping Class slug or the full Shipping Class name.