Beispiel #1
0
        public async Task <IActionResult> Edit(int id, int quantity)
        {
            var basketItem = await _context.GetBasketItem(id);

            basketItem.Quantity = quantity;

            int amount = basketItem.Quantity;

            var product = await _productContext.GetProduct(basketItem.ProductID);

            var price = product.Price;

            basketItem.LineItemAmount = price * amount;

            await _context.UpdateBasketItem(id, basketItem);

            return(RedirectToAction("Index"));
        }
        public async Task UpdateQuantity(int basketId, int productId, int quantity)
        {
            BasketItem item = await _bsktManager.GetBasketItem(productId, basketId);

            await _bsktManager.UpdateBasketItem(item, quantity);
        }