Hello!
We have variable products on the website, and the client would like the price range not to be displayed. Instead, they want only the starting price (minimum price) to appear.
To achieve this, I added the following code:
add_filter( ‘woocommerce_variable_price_html’, ‘show_minimum_price_only’, 10, 2 );
function show_minimum_price_only( $price, $product ) {
$min_price = $product->get_variation_price( ‘min’, true );
return wc_price( $min_price );
}
Now the starting price is displayed correctly. However, when a variation is selected, the price for that variation appears below in small text.
The client would like this small final price to disappear and instead have the main price at the top (the large one) update dynamically when a variation is selected.
I have attached some explanations/screenshots for clarity.
Attachments:
You must be
logged in to view attached files.