public function removeCoupon(
        CartInterface $cart,
        CouponInterface $coupon
    ) {
        $cartCoupons = $this
            ->cartCouponDirector
            ->findBy([
                'cart' => $cart,
                'coupon' => $coupon,
            ]);

        if (empty($cartCoupons)) {
            return false;
        }

        foreach ($cartCoupons as $cartCoupon) {
            $this
                ->cartCouponEventDispatcher
                ->dispatchCartCouponOnRemoveEvent(
                    $cartCoupon
                );
        }

        return true;
    }
public function removeCoupon(
        CartInterface $cart,
        CouponInterface $coupon
    ) {
        $cartCoupons = $this
            ->cartCouponDirector
            ->findBy([
                'cart' => $cart,
                'coupon' => $coupon,
            ]);

        if (empty($cartCoupons)) {
            return false;
        }

        foreach ($cartCoupons as $cartCoupon) {
            $this
                ->cartCouponEventDispatcher
                ->dispatchCartCouponOnRemoveEvent(
                    $cartCoupon
                );
        }

        return true;
    }
public function removeCoupon ( CartInterface $ cart , CouponInterface $ coupon ) { $ cartCoupons = $ this -> cartCouponDirector -> findBy ( [ 'cart' => $ cart , 'coupon' => $ coupon , ] ) ; if ( empty ( $ cartCoupons ) ) { return false ; } foreach ( $ cartCoupons as $ cartCoupon ) { $ this -> cartCouponEventDispatcher -> dispatchCartCouponOnRemoveEvent ( $ cartCoupon ) ; } return true ; }
Removes a Coupon from a Cart, and recalculates Cart Totals.

@param CartInterface   $cart   Cart
@param CouponInterface $coupon The coupon to remove

@return bool Coupon has been removed from cart
Removes a Coupon from a Cart and recalculates Cart Totals .