dist/sofa.js
function () {
        var activeCoupons = basketService.getActiveCoupons();

        var oldCouponCodes = activeCoupons.map(function (activeCoupon) {
            return activeCoupon.code;
        });

        basketService.clearCoupons();

        oldCouponCodes.forEach(function (couponCode) {
            self.submitCode(couponCode);
        });
    }
function () {
        var activeCoupons = basketService.getActiveCoupons();

        var oldCouponCodes = activeCoupons.map(function (activeCoupon) {
            return activeCoupon.code;
        });

        basketService.clearCoupons();

        oldCouponCodes.forEach(function (couponCode) {
            self.submitCode(couponCode);
        });
    }
function ( ) { var activeCoupons = basketService . getActiveCoupons ( ) ; var oldCouponCodes = activeCoupons . map ( function ( activeCoupon ) { return activeCoupon . code ; } ) ; basketService . clearCoupons ( ) ; oldCouponCodes . forEach ( function ( couponCode ) { self . submitCode ( couponCode ) ; } ) ; }
When the cart changes, refresh the values of the coupons by sending them to the backend along with the new cart
When the cart changes refresh the values of the coupons by sending them to the backend along with the new cart