public void Describe(DescribeCouponLineApplicabilityContext describe)
        {
            var isAvailableForConfiguration = IsAvailableForConfiguration();
            var isAvailableForProcessing    = IsAvailableForProcessing();

            describe
            .For("Cart", T("Cart products"), T("Cart products"))
            // Product in line MUST have selected term
            .Element("Line product is in category",
                     T("Line product is in the given category (if any was selected)"),
                     T("Line product is in the given category (if any was selected)"),
                     (ctx) => ApplyCriterion(ctx, (b) => b),
                     (ctx) => DisplayTrueLabel(ctx),
                     (ctx) => T("Coupon {0} is not valid for any product in your cart.", ctx.Coupon.Code),
                     isAvailableForConfiguration, isAvailableForProcessing,
                     SelectTermsFormForLines.FormName)
            // Product in line MUST not have selected term
            .Element("Line product is not in category",
                     T("Line product is not in the given category (if any was selected)"),
                     T("Line product is not in the given category (if any was selected)"),
                     (ctx) => ApplyCriterion(ctx, (b) => !b),
                     (ctx) => DisplayFalseLabel(ctx),
                     (ctx) => T("Coupon {0} is not valid for any product in your cart.", ctx.Coupon.Code),
                     isAvailableForConfiguration, isAvailableForProcessing,
                     SelectTermsFormForLines.FormName);
        }
Exemplo n.º 2
0
        public void Describe(DescribeCouponLineApplicabilityContext describe)
        {
            var isAvailableForConfiguration = IsAvailableForConfiguration();
            var isAvailableForProcessing    = IsAvailableForProcessing();

            describe
            .For("Cart", T("Cart products"), T("Cart products"))
            // Product in line MUST BE one of the selected types
            .Element("Line product is of type",
                     T("Line product is of a given type"),
                     T("Line product is of a given type"),
                     (ctx) => ApplyCriterion(ctx, (b) => b),
                     (ctx) => DisplayTrueLabel(ctx),
                     (ctx) => T("Coupon {0} is not valid for any product in your cart.", ctx.Coupon.Code),
                     isAvailableForConfiguration, isAvailableForProcessing,
                     ProductContentTypeForm.FormName)
            // Product in line MUST NOT BE one of the selected types
            .Element("Line product is not of type",
                     T("Line product is not of a given type"),
                     T("Line product is not of a given type"),
                     (ctx) => ApplyCriterion(ctx, (b) => !b),
                     (ctx) => DisplayFalseLabel(ctx),
                     (ctx) => T("Coupon {0} is not valid for any product in your cart.", ctx.Coupon.Code),
                     isAvailableForConfiguration, isAvailableForProcessing,
                     ProductContentTypeForm.FormName);
        }
        public void Describe(DescribeCouponLineApplicabilityContext describe)
        {
            var isAvailableForConfiguration = IsAvailableForConfiguration();
            var isAvailableForProcessing    = IsAvailableForProcessing();

            describe
            .For("Cart", T("Cart products"), T("Cart products"))
            .Element("Line product should not be discounted",
                     T("Line product should not be discounted"),
                     T("Line product should not be discounted"),
                     (ctx) => ApplyCriterion(ctx),
                     (ctx) => T("Line product should not be discounted."),
                     (ctx) => T("Coupon {0} is not valid for any product in your cart.", ctx.Coupon.Code),
                     isAvailableForConfiguration, isAvailableForProcessing,
                     null);
        }