Hello,
I recently have turned on WoodMart option to hide “to” price.
However when “to” price is hidden it is misleading to the customers. Is there a way to show a prefix for product prices to write “From” before the variable product price?
I tried standard code for WooCommerce as shown below but it did not work. Maybe theme has workaround or planning to launch such function soon?
Code:
add_filter( ‘woocommerce_variable_price_html’, ‘custom_prefix_variable_product_price’, 10, 2 );
function custom_prefix_variable_product_price( $price, $product ) {
// Prefix text
$prefix = ‘From ‘;
// Check if it’s a product archive page
if ( is_product_category() || is_product_tag() || is_shop() || is_post_type_archive( ‘product’ ) ) {
// Add the prefix before the price
$price = $prefix . $price;
}
return $price;
}
Thanks!