| @@ 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 ) { |
|
| @@ 2188-2190 (lines=3) @@ | ||
| 2185 | $this->remove_order_items( 'tax' ); |
|
| 2186 | ||
| 2187 | // Now merge to keep tax rows. |
|
| 2188 | foreach ( array_keys( $cart_taxes + $shipping_taxes ) as $tax_rate_id ) { |
|
| 2189 | $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 ); |
|
| 2190 | } |
|
| 2191 | ||
| 2192 | // Save tax totals |
|
| 2193 | $this->set_total( WC_Tax::round( array_sum( $shipping_taxes ) ), 'shipping_tax' ); |
|
| @@ 2335-2337 (lines=3) @@ | ||
| 2332 | $this->remove_order_items( 'tax' ); |
|
| 2333 | ||
| 2334 | // Now merge to keep tax rows |
|
| 2335 | foreach ( array_keys( $taxes + $shipping_taxes ) as $tax_rate_id ) { |
|
| 2336 | $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 ); |
|
| 2337 | } |
|
| 2338 | ||
| 2339 | return true; |
|
| 2340 | } |
|