get_variation_price( 'min', true ), $product->get_variation_price( 'max', true ) ); $price = $prices[0] !== $prices[1] ? sprintf( __( '%1$s'), 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( __( '%1$s'), wc_price( $prices[0] ) ) : wc_price( $prices[0] ); if ( $price !== $saleprice ) { $price = '' . $saleprice . ' ' . $price . ''; } return $price . $product->get_price_suffix(); } function wc_wc20_grouped_price_format( $price, $product ) { $tax_display_mode = get_option( 'woocommerce_tax_display_shop' ); $child_prices = array(); foreach ( $product->get_children() as $child_id ) { $child_prices[] = get_post_meta( $child_id, '_price', true ); } $child_prices = array_unique( $child_prices ); $get_price_method = 'get_price_' . $tax_display_mode . 'uding_tax'; if ( ! empty( $child_prices ) ) { $min_price = min( $child_prices ); $max_price = max( $child_prices ); } else { $min_price = ''; $max_price = ''; } if ( $min_price == $max_price ) { $display_price = wc_price( $product->$get_price_method( 1, $min_price ) ); } else { $from = wc_price( $product->$get_price_method( 1, $min_price ) ); $display_price = sprintf( __( 'From %1$s'), $from ); } return $display_price; } /// script when choose variation price function fix_footer(){ ob_start(); ?>