I need snipet for encrease price of product in woocommerce by *x time but only for certain tag. Eg. if product tag is "test" then price is multiply by 2.5 times. I tryed with this code but in cart and checkout page not shown new price, only on shop and single product page.
function return_custom_price($price, $product) {
if ( has_term( 'test', 'product_tag' ) ) {
global $post, $blog_id;
$product = wc_get_product( $post_id );
$post_id = $post->ID;
$price = ($price*2.5);
return $price;
} else {
return $price;
}
}
add_filter('woocommerce_get_price', 'return_custom_price', 10, 2);