Code Duplication    Length = 3-3 lines in 3 locations

includes/class-wc-ajax.php 1 location

@@ 1616-1618 (lines=3) @@
1613
		$order->remove_order_items( 'tax' );
1614
1615
		// Add tax rows
1616
		foreach ( array_keys( $taxes + $shipping_taxes ) as $tax_rate_id ) {
1617
			$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 );
1618
		}
1619
1620
		// Create the new order_taxes
1621
		foreach ( $order->get_taxes() as $tax_id => $tax_item ) {

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

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