public BasketDetailView UpdateItems(DTOs.BasketQtyUpdateRequest basketQtyUpdateRequest) { var request = new ModifyBasketRequest(); request.BasketId = base.GetBasketId(); request.ItemsToUpdate = DTOs.DtoMapper.ConvertToBasketItemUpdateRequests( basketQtyUpdateRequest); BasketDetailView basketDetailView = new BasketDetailView(); ModifyBasketResponse reponse = _basketService.ModifyBasket(request); SaveBasketSummaryToCookie(reponse.Basket.NumberOfItems, reponse.Basket.BasketTotal); basketDetailView.BasketSummary = new BasketSummaryView() { BasketTotal = reponse.Basket.BasketTotal, NumberOfItems = reponse.Basket.NumberOfItems }; basketDetailView.Basket = reponse.Basket; basketDetailView.DeliveryOptions = _basketService .GetAllDispatchOptions().DeliveryOptions; return(basketDetailView); }
public static IList <ProductQtyUpdateRequest> ConvertToBasketItemUpdateRequests( BasketQtyUpdateRequest basketQtyUpdateRequest) { return(ConvertToBasketItemUpdateRequests(basketQtyUpdateRequest.Items)); }