Append variable price suffix only once
This commit is contained in:
parent
acd6bf9cb7
commit
a274000d34
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue