Code Duplication    Length = 3-3 lines in 3 locations

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

@@ 728-730 (lines=3) @@
725
		$this->remove_order_items( 'tax' );
726
727
		// Now merge to keep tax rows
728
		foreach ( array_keys( $taxes + $shipping_taxes ) as $tax_rate_id ) {
729
			$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 );
730
		}
731
732
		return true;
733
	}
@@ 800-802 (lines=3) @@
797
		$this->remove_order_items( 'tax' );
798
799
		// Now merge to keep tax rows.
800
		foreach ( array_keys( $order_taxes + $order_shipping_taxes ) as $tax_rate_id ) {
801
			$this->add_tax( $tax_rate_id, isset( $order_taxes[ $tax_rate_id ] ) ? $order_taxes[ $tax_rate_id ] : 0, isset( $order_shipping_taxes[ $tax_rate_id ] ) ? $order_shipping_taxes[ $tax_rate_id ] : 0 );
802
		}
803
804
		// Save tax totals
805
		$this->set_total( WC_Tax::round( array_sum( $order_shipping_taxes ) ), 'shipping_tax' );

includes/class-wc-ajax.php 1 location

@@ 1638-1640 (lines=3) @@
1635
		$order->remove_order_items( 'tax' );
1636
1637
		// Add tax rows
1638
		foreach ( array_keys( $taxes + $shipping_taxes ) as $tax_rate_id ) {
1639
			$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 );
1640
		}
1641
1642
		// Create the new order_taxes
1643
		foreach ( $order->get_taxes() as $tax_id => $tax_item ) {