I'm looking to hide variable products price range only on the single product pages for the product that is currently being viewed. I do not want the price range to be disabled for all the products listed in the "Related Products" below and any products listed in the widgets in the footer as well.
Everyone of the snippets I've found so far hides the price range for every product listed on the single products page. It also hides the price completely from view from the variable products that have the exact same price for all of them since they do not display below the drop down when selected.
Here is an example of a snippet I've found:
/*
Disable Variable Product Price Range completely:
*/
add_filter( 'woocommerce_variable_sale_price_html', 'my_remove_variation_price', 10, 2 );
add_filter( 'woocommerce_variable_price_html', 'my_remove_variation_price', 10, 2 );
function my_remove_variation_price( $price ) {
$price = '';
return $price;
}
Example of price issue below: