This topic has 2 replies, 2 voices, and was last updated 9 years, 1 months ago ago by Robert Hall
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?
Hello,
Please provide us with wp-admin and FTP credentials in Private Content.
Regards,
Robert Hall.
You must be logged in to reply to this topic.Log in/Sign up