fix string + string for PHP 8.X (#38534)
This commit is contained in:
commit
d8e534410f
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: fix
|
||||||
|
|
||||||
|
fix string + string for PHP 8.X
|
|
@ -489,9 +489,9 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
||||||
*/
|
*/
|
||||||
public function get_total_discount( $ex_tax = true ) {
|
public function get_total_discount( $ex_tax = true ) {
|
||||||
if ( $ex_tax ) {
|
if ( $ex_tax ) {
|
||||||
$total_discount = $this->get_discount_total();
|
$total_discount = (float) $this->get_discount_total();
|
||||||
} else {
|
} else {
|
||||||
$total_discount = $this->get_discount_total() + $this->get_discount_tax();
|
$total_discount = (float) $this->get_discount_total() + (float) $this->get_discount_tax();
|
||||||
}
|
}
|
||||||
return apply_filters( 'woocommerce_order_get_total_discount', NumberUtil::round( $total_discount, WC_ROUNDING_PRECISION ), $this );
|
return apply_filters( 'woocommerce_order_get_total_discount', NumberUtil::round( $total_discount, WC_ROUNDING_PRECISION ), $this );
|
||||||
}
|
}
|
||||||
|
@ -2176,7 +2176,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Show shipping including tax.
|
// Show shipping including tax.
|
||||||
$shipping = wc_price( $this->get_shipping_total() + $this->get_shipping_tax(), array( 'currency' => $this->get_currency() ) );
|
$shipping = wc_price( (float) $this->get_shipping_total() + (float) $this->get_shipping_tax(), array( 'currency' => $this->get_currency() ) );
|
||||||
|
|
||||||
if ( (float) $this->get_shipping_tax() > 0 && ! $this->get_prices_include_tax() ) {
|
if ( (float) $this->get_shipping_tax() > 0 && ! $this->get_prices_include_tax() ) {
|
||||||
$shipping .= apply_filters( 'woocommerce_order_shipping_to_display_tax_label', ' <small class="tax_label">' . WC()->countries->inc_tax_or_vat() . '</small>', $this, $tax_display );
|
$shipping .= apply_filters( 'woocommerce_order_shipping_to_display_tax_label', ' <small class="tax_label">' . WC()->countries->inc_tax_or_vat() . '</small>', $this, $tax_display );
|
||||||
|
|
Loading…
Reference in New Issue