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:
Brent Shepherd 2017-09-21 16:48:32 -07:00
parent abc43c473e
commit 89e932c338
1 changed files with 1 additions and 1 deletions

View File

@ -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;