Code Duplication    Length = 3-3 lines in 3 locations

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' );

includes/class-wc-ajax.php 1 location

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