Example #1
0
        public HashSet <CartItem> Get(CartItemBasedDiscountApplication application, CartModel cart)
        {
            var cartItems = new HashSet <CartItem>();

            cartItems.AddRange(_getCartItemsBySKUList.GetCartItems(cart, application.SKUs));
            cartItems.AddRange(_getCartItemsByCategoryIdList.GetCartItems(cart, application.CategoryIds));
            return(cartItems);
        }
Example #2
0
        public override CheckLimitationsResult CheckLimitations(ItemHasSKU limitation, CartModel cart)
        {
            var cartItems = _getCartItemsBySKUList.GetCartItems(cart, limitation.SKUs);

            return(cartItems.Any()
                ? CheckLimitationsResult.Successful(cartItems)
                : CheckLimitationsResult.CurrentlyInvalid(
                       _stringResourceProvider.GetValue(
                           "You don't have the required item(s) in your cart for this discount")));
        }