| @@ 2169-2171 (lines=3) @@ | ||
| 2166 | $this->remove_order_items( 'tax' ); |
|
| 2167 | ||
| 2168 | // Now merge to keep tax rows. |
|
| 2169 | foreach ( array_keys( $cart_taxes + $shipping_taxes ) as $tax_rate_id ) { |
|
| 2170 | $this->add_tax( $tax_rate_id, isset( $cart_taxes[ $tax_rate_id ] ) ? $cart_taxes[ $tax_rate_id ] : 0, isset( $shipping_taxes[ $tax_rate_id ] ) ? $shipping_taxes[ $tax_rate_id ] : 0 ); |
|
| 2171 | } |
|
| 2172 | ||
| 2173 | // Save tax totals |
|
| 2174 | $this->set_total( WC_Tax::round( array_sum( $shipping_taxes ) ), 'shipping_tax' ); |
|
| @@ 2316-2318 (lines=3) @@ | ||
| 2313 | $this->remove_order_items( 'tax' ); |
|
| 2314 | ||
| 2315 | // Now merge to keep tax rows |
|
| 2316 | foreach ( array_keys( $taxes + $shipping_taxes ) as $tax_rate_id ) { |
|
| 2317 | $this->add_tax( $tax_rate_id, isset( $taxes[ $tax_rate_id ] ) ? $taxes[ $tax_rate_id ] : 0, isset( $shipping_taxes[ $tax_rate_id ] ) ? $shipping_taxes[ $tax_rate_id ] : 0 ); |
|
| 2318 | } |
|
| 2319 | ||
| 2320 | return true; |
|
| 2321 | } |
|
| @@ 1636-1638 (lines=3) @@ | ||
| 1633 | $order->remove_order_items( 'tax' ); |
|
| 1634 | ||
| 1635 | // Add tax rows |
|
| 1636 | foreach ( array_keys( $taxes + $shipping_taxes ) as $tax_rate_id ) { |
|
| 1637 | $order->add_tax( $tax_rate_id, isset( $taxes[ $tax_rate_id ] ) ? $taxes[ $tax_rate_id ] : 0, isset( $shipping_taxes[ $tax_rate_id ] ) ? $shipping_taxes[ $tax_rate_id ] : 0 ); |
|
| 1638 | } |
|
| 1639 | ||
| 1640 | // Create the new order_taxes |
|
| 1641 | foreach ( $order->get_taxes() as $tax_id => $tax_item ) { |
|