I have a new custom field named super_sale_price, and I'm trying to use that value for every product, so if this custom field value is exists,then we will show this in every where for that product,
I used this to display that price,
function return_custom_price($price, $product) {
global $post, $blog_id;
$price = get_post_meta($post->ID, 'super_sale_price', true);
return $price;
}
add_filter('woocommerce_get_price', 'return_custom_price', 10, 2);
This changes value in single product page, but once I add this product to cart, there the price shows 0. Please someone tell me why this happening ? Is this is a wrong hook?