Append variable price suffix only once

This commit is contained in:
Brent Shepherd 2017-06-06 13:40:36 -07:00
parent acd6bf9cb7
commit a274000d34
1 changed files with 4 additions and 4 deletions

View File

@ -143,14 +143,14 @@ class WC_Product_Variable extends WC_Product {
$max_reg_price = end( $prices['regular_price'] );
if ( $min_price !== $max_price ) {
$price = wc_format_price_range( $min_price, $max_price ) . $this->get_price_suffix();
$price = wc_format_price_range( $min_price, $max_price );
} elseif ( $this->is_on_sale() && $min_reg_price === $max_reg_price ) {
$price = wc_format_sale_price( wc_price( $max_reg_price ), wc_price( $min_price ) ) . $this->get_price_suffix();
$price = wc_format_sale_price( wc_price( $max_reg_price ), wc_price( $min_price ) );
} else {
$price = wc_price( $min_price ) . $this->get_price_suffix();
$price = wc_price( $min_price );
}
$price = apply_filters( 'woocommerce_variable_price_html', $price, $this );
$price = apply_filters( 'woocommerce_variable_price_html', $price . $this->get_price_suffix(), $this );
}
return apply_filters( 'woocommerce_get_price_html', $price, $this );