I’m trying to override the prices in Woocommerce, and it should work using the following code placed in the functions file:
function return_custom_price($price, $product) {
global $post, $blog_id;
$price = get_post_meta($post->ID, ‘_regular_price’);
$post_id = $post->ID;
$price = 1.23;
return $price;
}
add_filter(‘woocommerce_template_single_price’, ‘return_custom_price’, 10, 2);
This should return all prices as 1.23, however it’s not working. It’s as if the single product page isn’t recognising the override. Can you help me with why this might happen in your theme?