Answer the question
In order to leave comments, you need to log in
How can I make it so that when selecting a specific product, only its price is displayed (and not a price range)?
The whole point of the question is stated. It's not at all clear why they made such an inconvenient decision in terms of displaying the price range.
At the moment, I found only a paid solution: www.mojomarketplace.com/item/simple-variation-pric...
I found a script that needs to be added to the theme's function.
add_filter( 'woocommerce_variable_sale_price_html', 'wc_wc20_variation_price_format', 10, 2 );
add_filter( 'woocommerce_variable_price_html', 'wc_wc20_variation_price_format', 10, 2 );
function wc_wc20_variation_price_format( $price, $product ) {
$price = wc_price( min( $product->get_variation_price( 'min', true ), $product->get_variation_price( 'max', true ) ) );
return $price;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question