/// <summary>
        /// ((PromotionEvaluationContext)x).GetCartItemsQuantity(ExcludingCategoryIds, ExcludingProductIds) > NumItem
        /// </summary>
        public override bool Evaluate(IEvaluationContext context)
        {
            var result = false;

            if (context is PromotionEvaluationContext promotionEvaluationContext)
            {
                var quantity = promotionEvaluationContext.GetCartItemsQuantity(ExcludingCategoryIds.ToArray(), ExcludingProductIds.ToArray());
                result = UseCompareCondition(quantity, NumItem, NumItemSecond);
            }

            return(result);
        }
Esempio n. 2
0
        /// <summary>
        /// ((PromotionEvaluationContext)x).IsItemInCategory(CategoryId, ExcludingCategoryIds, ExcludingProductIds)
        /// </summary>
        public override bool Evaluate(IEvaluationContext context)
        {
            var result = false;

            if (context is PromotionEvaluationContext promotionEvaluationContext)
            {
                result = promotionEvaluationContext.IsItemInCategory(CategoryId, ExcludingCategoryIds.ToArray(), ExcludingProductIds.ToArray());
            }

            return(result);
        }