woocommerce update regular price

Job ID: 34677939

Budget: $10 – $30 USD

Hello,

I want to update regular prices with plugin function.

I already update stock with an array and a foreach loop.
The array has unique product identifiers set on post_content

I update like this

foreach($array_stock as $key_stock => $value_stock)
{
$update_posts_stock = $wpdb->query( "update ".$wpdb->prefix."posts set post_status='publish' where post_content like '%<!-- $value_stock -->%'");
}


Now I want to update regular prices on database the same way. I have an array with unique identifier as key and new prices as value

foreach($array_prices as $key_price => $value_price)
{
// mysql code to update regular prices
}
Related categories: PHP WordPress Software Architecture MySQL WooCommerce