Code Duplication    Length = 12-12 lines in 2 locations

includes/abstracts/abstract-wc-order.php 2 locations

@@ 1381-1392 (lines=12) @@
1378
		$existing_taxes = $this->get_taxes();
1379
		$saved_rate_ids = array();
1380
1381
		foreach ( $this->get_items( array( 'line_item', 'fee' ) ) as $item_id => $item ) {
1382
			$taxes = $item->get_taxes();
1383
			foreach ( $taxes['total'] as $tax_rate_id => $tax ) {
1384
				$tax_amount = (float) $tax;
1385
1386
				if ( 'yes' !== get_option( 'woocommerce_tax_round_at_subtotal' ) ) {
1387
					$tax_amount = wc_round_tax_total( $tax_amount );
1388
				}
1389
1390
				$cart_taxes[ $tax_rate_id ] = isset( $cart_taxes[ $tax_rate_id ] ) ? $cart_taxes[ $tax_rate_id ] + $tax_amount : $tax_amount;
1391
			}
1392
		}
1393
1394
		foreach ( $this->get_shipping_methods() as $item_id => $item ) {
1395
			$taxes = $item->get_taxes();
@@ 1394-1405 (lines=12) @@
1391
			}
1392
		}
1393
1394
		foreach ( $this->get_shipping_methods() as $item_id => $item ) {
1395
			$taxes = $item->get_taxes();
1396
			foreach ( $taxes['total'] as $tax_rate_id => $tax ) {
1397
				$tax_amount = (float) $tax;
1398
1399
				if ( 'yes' !== get_option( 'woocommerce_tax_round_at_subtotal' ) ) {
1400
					$tax_amount = wc_round_tax_total( $tax_amount );
1401
				}
1402
1403
				$shipping_taxes[ $tax_rate_id ] = isset( $shipping_taxes[ $tax_rate_id ] ) ? $shipping_taxes[ $tax_rate_id ] + $tax_amount : $tax_amount;
1404
			}
1405
		}
1406
1407
		foreach ( $existing_taxes as $tax ) {
1408
			// Remove taxes which no longer exist for cart/shipping.