ConvertToBasketItemUpdateRequests(
     this JsonBasketQtyUpdateRequest jsonBasketQtyUpdateRequest)
 {
     return(jsonBasketQtyUpdateRequest.Items
            .ConvertToBasketItemUpdateRequests());
 }
        public JsonResult UpdateItems(
                                JsonBasketQtyUpdateRequest jsonBasketQtyUpdateRequest)
        {
            ModifyBasketRequest request = new ModifyBasketRequest();
            request.BasketId = base.GetBasketId();
            request.ItemsToUpdate = jsonBasketQtyUpdateRequest
                                           .ConvertToBasketItemUpdateRequests(); ;

            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 Json(basketDetailView);
        }