You will need something like this:
add_filter( 'woocommerce_sale_price_html', 'custom_remove_price_html', 20, 2 );
add_filter( 'woocommerce_price_html', 'custom_remove_price_html', 20, 2 );
add_filter( 'woocommerce_empty_price_html', 'custom_remove_price_html', 20, 2 );
add_filter( 'woocommerce_variable_sale_price_html', 'custom_remove_price_html', 20, 2 );
add_filter( 'woocommerce_variable_price_html', 'custom_remove_price_html', 20, 2 );
add_filter( 'woocommerce_variable_empty_price_html', 'custom_remove_price_html', 20, 2 );
add_filter( 'woocommerce_variation_sale_price_html', 'custom_remove_price_html', 20, 2 );
add_filter( 'woocommerce_variation_price_html', 'custom_remove_price_html', 20, 2 );
function custom_remove_price_html( $price, $product ) {
// if this is a product is a variable product.
if ( $product->is_type( 'variable' ) ) { // updated
// $price = '';
return;
}
return $price;
}
If it doesn't work as you want, you will need to fine tune conditionals inside the function, to feet your needs.
You have to add this code snippet in the functions.php
file of your active theme (or better of your active child theme).