Reputation: 167
I am failing to get the correct hook to get rid of this kind of prices →
in woocommerce single product page.
I tried many that were available on the Internet, but could not get rid of any of the remove_action
Upvotes: 1
Views: 710
Reputation: 11861
Try below code snippet.
add_filter('woocommerce_get_price_html', "wt_hide_regular_price", 99, 2);
function wt_hide_regular_price($price, $product)
{
if(!is_cart() && !is_checkout() && !is_ajax()){
if ($product->is_type('simple') || $product->is_type('variation')) {
return wt_regular_price_for_product($price, $product);
}
}
return $price;
}
function wt_regular_price_for_product($price, $product){
return wc_price($product->get_price());
}
Upvotes: 1