Exemple #1
0
        public void Describe(DescribeCouponApplicabilityContext describe)
        {
            var isAvailableForConfiguration = IsAvailableForConfiguration();
            var isAvailableForProcessing    = IsAvailableForProcessing();

            describe
            .For("Cart", T("Cart products"), T("Cart products"))
            // Product MUST have selected term
            .Element("Cart has Products in the category",
                     T("Line products are in the given category (if any was selected)"),
                     T("Line products are in the given category (if any was selected)"),
                     (ctx) => ApplyCriterion(ctx, (b) => b),
                     (ctx) => ApplyCriterion(ctx, (b) => b),
                     (ctx) => DisplayTrueLabel(ctx),
                     isAvailableForConfiguration, isAvailableForProcessing,
                     SelectTermsForm.FormName)
            // Product MUST not have selected term
            .Element("Cart has not Products in the category",
                     T("Line products are not in the given category (if any was selected)"),
                     T("Line products are not in the given category (if any was selected)"),
                     (ctx) => ApplyCriterion(ctx, (b) => !b),
                     (ctx) => ApplyCriterion(ctx, (b) => !b),
                     (ctx) => DisplayFalseLabel(ctx),
                     isAvailableForConfiguration, isAvailableForProcessing,
                     SelectTermsForm.FormName);
        }
Exemple #2
0
        public void Describe(DescribeCouponApplicabilityContext describe)
        {
            var isAvailableForConfiguration = IsAvailableForConfiguration();
            var isAvailableForProcessing    = IsAvailableForProcessing();

            describe
            .For("Cart", T("Cart products"), T("Cart products"))
            .Element("Cart has Products of given type",
                     T("Cart has Products of given type"),
                     T("Cart has Products of given type"),
                     (ctx) => ApplyCriteria(ctx, (b) => b,
                                            T("Coupon {0} is only available if cart contains products of type {1}.", ctx.CouponRecord.Code, ProductTypes(ctx))),
                     (ctx) => ApplyCriteria(ctx, (b) => b,
                                            T("Coupon {0} is only available if cart contains products of type {1}.", ctx.CouponRecord.Code, ProductTypes(ctx))),
                     (ctx) => DisplayTrueLabel(ctx),
                     isAvailableForConfiguration, isAvailableForProcessing,
                     ProductContentTypeForm.FormName)
            .Element("Cart doesn't have Products of given type",
                     T("Cart doesn't have Products of given type"),
                     T("Cart doesn't have Products of given type"),
                     (ctx) => ApplyCriteria(ctx, (b) => !b,
                                            T("Coupon {0} is only available if cart doesn't contain products of type {1}.", ctx.CouponRecord.Code, ProductTypes(ctx))),
                     (ctx) => ApplyCriteria(ctx, (b) => !b,
                                            T("Coupon {0} is only available if cart doesn't contain products of type {1}.", ctx.CouponRecord.Code, ProductTypes(ctx))),
                     (ctx) => DisplayFalseLabel(ctx),
                     isAvailableForConfiguration, isAvailableForProcessing,
                     ProductContentTypeForm.FormName);
        }
        public void Describe(DescribeCouponApplicabilityContext describe)
        {
            var isAvailableForConfiguration = IsAvailableForConfiguration();
            var isAvailableForProcessing    = IsAvailableForProcessing();

            describe
            .For("Request", T("Http Request"), T("Http Request"))
            .Element("Test request cookies",
                     T("Test request cookies"),
                     T("Test request cookies"),
                     (ctx) => ApplyCriteria(ctx),
                     (ctx) => ApplyCriteria(ctx),
                     (ctx) => CookieValueForm.DisplayFilter(ctx.State, T),
                     isAvailableForConfiguration, isAvailableForProcessing,
                     CookieValueForm.FormName);
        }
        public void Describe(DescribeCouponApplicabilityContext describe)
        {
            var isAvailableForConfiguration = IsAvailableForConfiguration();
            var isAvailableForProcessing    = IsAvailableForProcessing();

            describe
            .For("Cart", T("Cart products"), T("Cart products"))
            .Element("Line products shuld not be discounted",
                     T("Line products should not be discounted"),
                     T("If there is a discounted product in the cart, the coupon cannot be applied."),
                     (ctx) => ApplyCriteria(ctx),
                     (ctx) => ApplyCriteria(ctx),
                     (ctx) => T("Coupon is applicable only if there is no discounted product in the cart."),
                     isAvailableForConfiguration, isAvailableForProcessing,
                     null);
        }
Exemple #5
0
        public void Describe(DescribeCouponApplicabilityContext describe)
        {
            var isAvailableForConfiguration = IsAvailableForConfiguration();
            var isAvailableForProcessing    = IsAvailableForProcessing();

            describe
            .For("Date validity",
                 T("Range of dates the coupon can be used in"),
                 T("Range of dates the coupon can be used in"))
            .Element("Date validity of the coupon",
                     T("Range of dates the coupon can be used in"),
                     T("Range of dates the coupon can be used in"),
                     (ctx) => ApplyCriterion(ctx),
                     (ctx) => ApplyCriterion(ctx),
                     (ctx) => Display(ctx),
                     isAvailableForConfiguration, isAvailableForProcessing,
                     LaserProjections.DateTimeFilterForm.FormName);
        }