Code Duplication    Length = 10-10 lines in 2 locations

includes/shipping/free-shipping/class-wc-shipping-free-shipping.php 1 location

@@ 103-112 (lines=10) @@
100
		$has_coupon         = false;
101
		$has_met_min_amount = false;
102
103
		if ( in_array( $this->requires, array( 'coupon', 'either', 'both' ) ) ) {
104
			if ( $coupons = WC()->cart->get_coupons() ) {
105
				foreach ( $coupons as $code => $coupon ) {
106
					if ( $coupon->is_valid() && $coupon->enable_free_shipping() ) {
107
						$has_coupon = true;
108
						break;
109
					}
110
				}
111
			}
112
		}
113
114
		if ( in_array( $this->requires, array( 'min_amount', 'either', 'both' ) ) && isset( WC()->cart->cart_contents_total ) ) {
115
			$total = WC()->cart->get_displayed_subtotal();

includes/shipping/legacy-free-shipping/class-wc-shipping-legacy-free-shipping.php 1 location

@@ 165-174 (lines=10) @@
162
		$has_coupon         = false;
163
		$has_met_min_amount = false;
164
165
		if ( in_array( $this->requires, array( 'coupon', 'either', 'both' ) ) ) {
166
167
			if ( $coupons = WC()->cart->get_coupons() ) {
168
				foreach ( $coupons as $code => $coupon ) {
169
					if ( $coupon->is_valid() && $coupon->enable_free_shipping() ) {
170
						$has_coupon = true;
171
					}
172
				}
173
			}
174
		}
175
176
		if ( in_array( $this->requires, array( 'min_amount', 'either', 'both' ) ) && isset( WC()->cart->cart_contents_total ) ) {
177
			if ( WC()->cart->prices_include_tax ) {