Fix shipping tax when calling calculate_shipping()
The $shipping_taxes is a multidimensional array so array_sum() does not correctly sum the values. The $merged_taxes is a single level array with all other taxes set, so array_sum() can be safely used on it.
This commit is contained in:
parent
abc43c473e
commit
89e932c338
|
@ -1282,7 +1282,7 @@ class WC_Cart extends WC_Legacy_Cart {
|
|||
}
|
||||
|
||||
$this->set_shipping_total( array_sum( wp_list_pluck( $this->shipping_methods, 'cost' ) ) );
|
||||
$this->set_shipping_tax( array_sum( $shipping_taxes ) );
|
||||
$this->set_shipping_tax( array_sum( $merged_taxes ) );
|
||||
$this->set_shipping_taxes( $merged_taxes );
|
||||
|
||||
return $this->shipping_methods;
|
||||
|
|
Loading…
Reference in New Issue