@@ 1447-1458 (lines=12) @@ | ||
1444 | $existing_taxes = $this->get_taxes(); |
|
1445 | $saved_rate_ids = array(); |
|
1446 | ||
1447 | foreach ( $this->get_items( array( 'line_item', 'fee' ) ) as $item_id => $item ) { |
|
1448 | $taxes = $item->get_taxes(); |
|
1449 | foreach ( $taxes['total'] as $tax_rate_id => $tax ) { |
|
1450 | $tax_amount = (float) $tax; |
|
1451 | ||
1452 | if ( 'yes' !== get_option( 'woocommerce_tax_round_at_subtotal' ) ) { |
|
1453 | $tax_amount = wc_round_tax_total( $tax_amount ); |
|
1454 | } |
|
1455 | ||
1456 | $cart_taxes[ $tax_rate_id ] = isset( $cart_taxes[ $tax_rate_id ] ) ? $cart_taxes[ $tax_rate_id ] + $tax_amount : $tax_amount; |
|
1457 | } |
|
1458 | } |
|
1459 | ||
1460 | foreach ( $this->get_shipping_methods() as $item_id => $item ) { |
|
1461 | $taxes = $item->get_taxes(); |
|
@@ 1460-1471 (lines=12) @@ | ||
1457 | } |
|
1458 | } |
|
1459 | ||
1460 | foreach ( $this->get_shipping_methods() as $item_id => $item ) { |
|
1461 | $taxes = $item->get_taxes(); |
|
1462 | foreach ( $taxes['total'] as $tax_rate_id => $tax ) { |
|
1463 | $tax_amount = (float) $tax; |
|
1464 | ||
1465 | if ( 'yes' !== get_option( 'woocommerce_tax_round_at_subtotal' ) ) { |
|
1466 | $tax_amount = wc_round_tax_total( $tax_amount ); |
|
1467 | } |
|
1468 | ||
1469 | $shipping_taxes[ $tax_rate_id ] = isset( $shipping_taxes[ $tax_rate_id ] ) ? $shipping_taxes[ $tax_rate_id ] + $tax_amount : $tax_amount; |
|
1470 | } |
|
1471 | } |
|
1472 | ||
1473 | foreach ( $existing_taxes as $tax ) { |
|
1474 | // Remove taxes which no longer exist for cart/shipping. |