Show minimum price for variable products on shop or single product
-
I am using the latest version of WooCommerce-2.5.5. But, it showing the maximum price for the variable product in shop and single product page https://bookyoga.com.au/flametreeyoga/all-passes// https://bookyoga.com.au/flametreeyoga/product/two-classes-per-week/. But I want to show the minimum price for the variable product (see screenshot https://imgur.com/ISCD9Hs).
I have tried many hooks for showing the minimum price but not working (like https://support.woothemes.com/hc/en-us/community/posts/202794676-Showing-only-1-price-for-variable-product and so many hooks). I have tried WooCommerce 2.1 variation price, revert to 2.0 format (https://gist.github.com/kloon/8981075) which also not working.
add_filter( 'woocommerce_variable_sale_price_html', 'get_min_variation_price_format', 10, 2 ); add_filter( 'woocommerce_variable_price_html', 'get_min_variation_price_format', 10, 2 ); function get_min_variation_price_format( $price, $product ) { $min_variation_price = $product->get_variation_regular_price( 'min'); return wc_price($min_variation_price); }
Please help me to solve the problem for showing the minimum price for the variable products instead of maximum price.
Regards.
- The topic ‘Show minimum price for variable products on shop or single product’ is closed to new replies.