|
@@ 2160-2170 (lines=11) @@
|
| 2157 |
|
$cart_taxes = array(); |
| 2158 |
|
$shipping_taxes = array(); |
| 2159 |
|
|
| 2160 |
|
foreach ( $this->get_items( array( 'line_item', 'fee' ) ) as $item_id => $item ) { |
| 2161 |
|
$taxes = $item->get_taxes(); |
| 2162 |
|
if ( isset( $taxes['total'] ) ) { |
| 2163 |
|
foreach ( $taxes['total'] as $tax_rate_id => $tax ) { |
| 2164 |
|
if ( ! isset( $cart_taxes[ $tax_rate_id ] ) ) { |
| 2165 |
|
$cart_taxes[ $tax_rate_id ] = 0; |
| 2166 |
|
} |
| 2167 |
|
$cart_taxes[ $tax_rate_id ] += $tax; |
| 2168 |
|
} |
| 2169 |
|
} |
| 2170 |
|
} |
| 2171 |
|
|
| 2172 |
|
foreach ( $this->get_items( array( 'shipping' ) ) as $item_id => $item ) { |
| 2173 |
|
$taxes = $item->get_taxes(); |
|
@@ 2172-2182 (lines=11) @@
|
| 2169 |
|
} |
| 2170 |
|
} |
| 2171 |
|
|
| 2172 |
|
foreach ( $this->get_items( array( 'shipping' ) ) as $item_id => $item ) { |
| 2173 |
|
$taxes = $item->get_taxes(); |
| 2174 |
|
if ( isset( $taxes['total'] ) ) { |
| 2175 |
|
foreach ( $taxes['total'] as $tax_rate_id => $tax ) { |
| 2176 |
|
if ( ! isset( $shipping_taxes[ $tax_rate_id ] ) ) { |
| 2177 |
|
$shipping_taxes[ $tax_rate_id ] = 0; |
| 2178 |
|
} |
| 2179 |
|
$shipping_taxes[ $tax_rate_id ] += $tax; |
| 2180 |
|
} |
| 2181 |
|
} |
| 2182 |
|
} |
| 2183 |
|
|
| 2184 |
|
// Remove old existing tax rows. |
| 2185 |
|
$this->remove_order_items( 'tax' ); |