Code Duplication    Length = 3-3 lines in 3 locations

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

@@ 714-716 (lines=3) @@
711
		$this->remove_order_items( 'tax' );
712
713
		// Now merge to keep tax rows
714
		foreach ( array_keys( $taxes + $shipping_taxes ) as $tax_rate_id ) {
715
			$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 );
716
		}
717
718
		return true;
719
	}
@@ 786-788 (lines=3) @@
783
		$this->remove_order_items( 'tax' );
784
785
		// Now merge to keep tax rows.
786
		foreach ( array_keys( $order_taxes + $order_shipping_taxes ) as $tax_rate_id ) {
787
			$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 );
788
		}
789
790
		// Save tax totals
791
		$this->set_total( WC_Tax::round( array_sum( $order_shipping_taxes ) ), 'shipping_tax' );

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 ) {