Hi @corestudio
Thanks for reaching out!
I understand that you want to display the lowest price only for your variable products.
I did some research and found this code snippet that worked on my site:
// Show only lowest prices in WooCommerce variable products
add_filter( 'woocommerce_variable_sale_price_html', 'wpglorify_variation_price_format', 10, 2 );
add_filter( 'woocommerce_variable_price_html', 'wpglorify_variation_price_format', 10, 2 );
function wpglorify_variation_price_format( $price, $product ) {
// Main Price
$prices = array( $product->get_variation_price( 'min', true ), $product->get_variation_price( 'max', true ) );
$price = $prices[0] !== $prices[1] ? sprintf( __( 'From: %1$s', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] );
// Sale Price
$prices = array( $product->get_variation_regular_price( 'min', true ), $product->get_variation_regular_price( 'max', true ) );
sort( $prices );
$saleprice = $prices[0] !== $prices[1] ? sprintf( __( 'From: %1$s', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] );
if ( $price !== $saleprice ) {
$price = '<del>' . $saleprice . $product->get_price_suffix() . '</del> <ins>' . $price . $product->get_price_suffix() . '</ins>';
}
return $price;
}
Output:

Image Link: https://snipboard.io/ZLgbU4.jpg
The code came from this link: https://wpglorify.com/show-lowest-price-woocommerce-variable-products/
Hope this helps!
It worked for me, thank you very much!
-
This reply was modified 3 years, 6 months ago by
corestudio.
I’m glad we were able to help, @corestudio! If you have a few minutes, we’d love if you could leave us a review: https://ww.wp.xz.cn/support/plugin/woocommerce/reviews/