| @@ 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 ) { |
|
| @@ 2193-2195 (lines=3) @@ | ||
| 2190 | $this->remove_order_items( 'tax' ); |
|
| 2191 | ||
| 2192 | // Now merge to keep tax rows. |
|
| 2193 | foreach ( array_keys( $cart_taxes + $shipping_taxes ) as $tax_rate_id ) { |
|
| 2194 | $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 ); |
|
| 2195 | } |
|
| 2196 | ||
| 2197 | // Save tax totals |
|
| 2198 | $this->set_total( WC_Tax::round( array_sum( $shipping_taxes ) ), 'shipping_tax' ); |
|
| @@ 2340-2342 (lines=3) @@ | ||
| 2337 | $this->remove_order_items( 'tax' ); |
|
| 2338 | ||
| 2339 | // Now merge to keep tax rows |
|
| 2340 | foreach ( array_keys( $taxes + $shipping_taxes ) as $tax_rate_id ) { |
|
| 2341 | $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 ); |
|
| 2342 | } |
|
| 2343 | ||
| 2344 | return true; |
|
| 2345 | } |
|