Code Duplication    Length = 7-7 lines in 2 locations

includes/class-wc-ajax.php 1 location

@@ 1608-1614 (lines=7) @@
1605
				'tax_class' => ''
1606
			) );
1607
1608
			if ( $tax_rates ) {
1609
				foreach ( $tax_rates as $key => $rate ) {
1610
					if ( isset( $rate['shipping'] ) && 'yes' == $rate['shipping'] ) {
1611
						$matched_tax_rates[ $key ] = $rate;
1612
					}
1613
				}
1614
			}
1615
1616
			$shipping_cost = $shipping_taxes = array();
1617

includes/abstracts/abstract-wc-order.php 1 location

@@ 2317-2323 (lines=7) @@
2314
                'tax_class' => ''
2315
            ) );
2316
2317
            if ( ! empty( $tax_rates ) ) {
2318
                foreach ( $tax_rates as $key => $rate ) {
2319
                    if ( isset( $rate['shipping'] ) && 'yes' === $rate['shipping'] ) {
2320
                        $matched_tax_rates[ $key ] = $rate;
2321
                    }
2322
                }
2323
            }
2324
2325
            $shipping_taxes     = WC_Tax::calc_shipping_tax( $this->order_shipping, $matched_tax_rates );
2326
            $shipping_tax_total = WC_Tax::round( array_sum( $shipping_taxes ) );