Hello,
To add “From-To” before the price range on variable products, you can use the following custom code in your child theme’s functions.php file:
add_filter('woocommerce_variable_price_html', 'custom_variable_price_format', 10, 2);
function custom_variable_price_format($price, $product) {
$min_price = wc_get_price_to_display($product, ['price' => $product->get_variation_price('min')]);
$max_price = wc_get_price_to_display($product, ['price' => $product->get_variation_price('max')]);
$price = sprintf(__('From %s To %s', 'woocommerce'), wc_price($min_price), wc_price($max_price));
return $price;
}
This will display the price range in the “From-To” format for all variable products.
Best Regards