public function removeCouponByCode(
        CartInterface $cart,
        $couponCode
    ) {
        $coupon = $this
            ->couponRepository
            ->findOneBy([
                'code' => $couponCode,
            ]);

        if (!($coupon instanceof CouponInterface)) {
            return false;
        }

        return $this
            ->removeCoupon(
                $cart,
                $coupon
            );
    }
public function removeCouponByCode(
        CartInterface $cart,
        $couponCode
    ) {
        $coupon = $this
            ->couponRepository
            ->findOneBy([
                'code' => $couponCode,
            ]);

        if (!($coupon instanceof CouponInterface)) {
            return false;
        }

        return $this
            ->removeCoupon(
                $cart,
                $coupon
            );
    }
public function removeCouponByCode ( CartInterface $ cart , $ couponCode ) { $ coupon = $ this -> couponRepository -> findOneBy ( [ 'code' => $ couponCode , ] ) ; if ( ! ( $ coupon instanceof CouponInterface ) ) { return false ; } return $ this -> removeCoupon ( $ cart , $ coupon ) ; }
Given a coupon code, removes it from cart.

@param CartInterface $cart       Cart
@param string        $couponCode Coupon code

@return bool Coupon has been removed from cart
Given a coupon code removes it from cart .