This topic has 6 replies, 2 voices, and was last updated 5 years, 8 months ago ago by Rose Tyler
Hello,
I have two questions about modifying the price display for variable products.
Firstly we would like to display in the shop and the category pages for it doesn’t show price range but instead “from: xx €”
Second question: on single product page we would not like to display price range just display the price when a customer picks a variation.
Can you help us with these modifications?
Thank you for the support
Darja
Hello,
1) You can add this code In functions.php of child-theme:
add_filter( 'woocommerce_variable_price_html', 'custom_variation_price_format_min', 9999, 2 );
function custom_variation_price_format_min( $price, $product ) {
$prices = $product->get_variation_prices( true );
$min_price = current( $prices['price'] );
$price = sprintf( __( 'From: %1$s', 'woocommerce' ), wc_price( $min_price ) );
return $price;
}
Read more – https://businessbloomer.com/disable-variable-product-price-range-woocommerce/
2)
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
https://businessbloomer.com/woocommerce-visual-hook-guide-single-product-page/
Regards
Hello,
Thank you for your help. The first part worked perfectly but the second that is about removing the price didn’t work. We copied the code provided exactly in functions.php file of the child theme.
Thank you for your support
Hello,
In this case, you can remove the price using custom CSS code:
.product-summary-fixed .price {
display: none;
}
Regards
Hello,
Thank you for your support. It now shows as we want it.
Hello,
You’re welcome!
Would you mind to rate our product: https://prnt.sc/d256m6 https://themeforest.net/downloads
That would be much appreciated ?
Regards
The issue related to '‘Product variations price display’' has been successfully resolved, and the topic is now closed for further responses