public HttpResponseMessage GetShippingMethods()
        {
            var data      = shippingMethodRepository.GetShippingMethods();
            var formatter = RequestFormat.JsonFormaterString();

            return(Request.CreateResponse(HttpStatusCode.OK, data, formatter));
        }
예제 #2
0
        public ViewResult Checkout(Cart cart)
        {
            var user = _userRepository.GetUserById(User.Identity.GetUserId());

            cart.UserId = user.Id;
            cart.User   = user;

            var viewModel = new CheckoutViewModel
            {
                Cart                     = cart,
                ShippingMethods          = ShippingMethodsProvider.CreateSelectList(_shippingMethodRepository.GetShippingMethods().ToList()),
                OrderValue               = cart.GetValue(),
                SelectedShippingMethodId = -1
            };

            ViewBag.CountryList = _countriesProvider.FillCountryList();

            return(View(viewModel));
        }