public List <int> GetCategories(ProductSearchQuery query)
        {
            var clone = query.Clone() as ProductSearchQuery;

            clone.CategoryId = null;
            Query searchQuery = GetQuery(clone);

            return(_getProductCategories.Get(searchQuery));
        }
Beispiel #2
0
        public List <CartItem> GetCartItems(CartModel cart, string categoryIds)
        {
            List <int> categories = (categoryIds ?? string.Empty).GetIntList();

            List <CartItem> cartItems =
                cart.Items.FindAll(x =>
            {
                Query query    = GetQuery(x.Item.Product.Id);
                List <int> ids = _getProductCategories.Get(query);
                return(categories.Intersect(ids).Any());
            });

            return(cartItems);
        }