Example #1
0
        public IActionResult ShopList(ShopListOptions options)
        {
            var repo = new EcomRepository();
            var cart = PageMaster.GetShoppingCart();

            int total;
            var model = new ShopListModel
            {
                ShopList = repo.GetShopList(options, cart, out total),
                Brands   = repo.GetAllBrands()
            };

            options.TotalItems = total;

            ViewBag.Options        = options;
            ViewBag.CountCartItems = cart.CartProducts != null?cart.CartProducts.Count() : 0;

            return(View(model));
        }