|
@@ 2141-2151 (lines=11) @@
|
| 2138 |
|
$cart_taxes = array(); |
| 2139 |
|
$shipping_taxes = array(); |
| 2140 |
|
|
| 2141 |
|
foreach ( $this->get_items( array( 'line_item', 'fee' ) ) as $item_id => $item ) { |
| 2142 |
|
$taxes = $item->get_taxes(); |
| 2143 |
|
if ( isset( $taxes['total'] ) ) { |
| 2144 |
|
foreach ( $taxes['total'] as $tax_rate_id => $tax ) { |
| 2145 |
|
if ( ! isset( $cart_taxes[ $tax_rate_id ] ) ) { |
| 2146 |
|
$cart_taxes[ $tax_rate_id ] = 0; |
| 2147 |
|
} |
| 2148 |
|
$cart_taxes[ $tax_rate_id ] += $tax; |
| 2149 |
|
} |
| 2150 |
|
} |
| 2151 |
|
} |
| 2152 |
|
|
| 2153 |
|
foreach ( $this->get_items( array( 'shipping' ) ) as $item_id => $item ) { |
| 2154 |
|
$taxes = $item->get_taxes(); |
|
@@ 2153-2163 (lines=11) @@
|
| 2150 |
|
} |
| 2151 |
|
} |
| 2152 |
|
|
| 2153 |
|
foreach ( $this->get_items( array( 'shipping' ) ) as $item_id => $item ) { |
| 2154 |
|
$taxes = $item->get_taxes(); |
| 2155 |
|
if ( isset( $taxes['total'] ) ) { |
| 2156 |
|
foreach ( $taxes['total'] as $tax_rate_id => $tax ) { |
| 2157 |
|
if ( ! isset( $shipping_taxes[ $tax_rate_id ] ) ) { |
| 2158 |
|
$shipping_taxes[ $tax_rate_id ] = 0; |
| 2159 |
|
} |
| 2160 |
|
$shipping_taxes[ $tax_rate_id ] += $tax; |
| 2161 |
|
} |
| 2162 |
|
} |
| 2163 |
|
} |
| 2164 |
|
|
| 2165 |
|
// Remove old existing tax rows. |
| 2166 |
|
$this->remove_order_items( 'tax' ); |