Code Duplication    Length = 9-10 lines in 2 locations

includes/class-wc-cart.php 2 locations

@@ 409-418 (lines=10) @@
406
			foreach ( $this->applied_coupons as $code ) {
407
				$coupon = new WC_Coupon( $code );
408
409
				if ( ! $coupon->is_valid() ) {
410
					// Error message
411
					$coupon->add_coupon_message( WC_Coupon::E_WC_COUPON_INVALID_REMOVED );
412
413
					// Remove the coupon
414
					$this->remove_coupon( $code );
415
416
					// Flag totals for refresh
417
					WC()->session->set( 'refresh_totals', true );
418
				}
419
			}
420
		}
421
@@ 1704-1712 (lines=9) @@
1701
								$usage_count = $usage_count + sizeof( array_keys( $used_by, $check_email ) );
1702
							}
1703
1704
							if ( $usage_count >= $coupon->usage_limit_per_user ) {
1705
								$coupon->add_coupon_message( WC_Coupon::E_WC_COUPON_USAGE_LIMIT_REACHED );
1706
1707
								// Remove the coupon
1708
								$this->remove_coupon( $code );
1709
1710
								// Flag totals for refresh
1711
								WC()->session->set( 'refresh_totals', true );
1712
							}
1713
						}
1714
					}
1715
				}