| @@ 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 ) { |
|
| @@ 2127-2129 (lines=3) @@ | ||
| 2124 | $this->remove_order_items( 'tax' ); |
|
| 2125 | ||
| 2126 | // Now merge to keep tax rows. |
|
| 2127 | foreach ( array_keys( $cart_taxes + $shipping_taxes ) as $tax_rate_id ) { |
|
| 2128 | $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 ); |
|
| 2129 | } |
|
| 2130 | ||
| 2131 | // Save tax totals |
|
| 2132 | $this->set_total( WC_Tax::round( array_sum( $shipping_taxes ) ), 'shipping_tax' ); |
|
| @@ 2274-2276 (lines=3) @@ | ||
| 2271 | $this->remove_order_items( 'tax' ); |
|
| 2272 | ||
| 2273 | // Now merge to keep tax rows |
|
| 2274 | foreach ( array_keys( $taxes + $shipping_taxes ) as $tax_rate_id ) { |
|
| 2275 | $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 ); |
|
| 2276 | } |
|
| 2277 | ||
| 2278 | return true; |
|
| 2279 | } |
|