Ejemplo n.º 1
0
        public IActionResult UpdateTotal(int basketId)
        {
            _basket.UpdateTotalWithPromotions();
            foreach (ProductLineItem item in _basket.Products)
            {
                _supermarketRepository.SaveBasketLineItem(_basket.BasketId, item);
            }

            var basketViewModel = new BasketViewModel
            {
                BasketId         = _basket.BasketId,
                ProductLineItems = _basket.Products,
                Total            = _basket.GetDiscountedTotal()
            };

            return(View("Index", basketViewModel));
        }