I have a shop that i now want on another domain and for that reason i need to update all prices on the new domain. I need to multiply all prices by 1.45.
I've tried an code snippet, which actually works great on simple products, but it does not work on variable/variations product.
function return_custom_price($price, $product) {
global $post, $blog_id;
$product = wc_get_product( $post_id );
$post_id = $post->ID;
$price = ($price*1.45);
return $price;
}
add_filter('woocommerce_get_price', 'return_custom_price', 10, 2);
I want this code to also multiply variation pricing by 1.45