/// <summary>
        /// The index <see cref="ActionResult"/>.
        /// </summary>
        /// <param name="model">
        /// The current render model.
        /// </param>
        /// <returns>
        /// The <see cref="ActionResult"/>.
        /// </returns>
        public override ActionResult Index(RenderModel model)
        {
            // Don't display the checkout form if there are no products (either due to timeout or manual URL entered)
            if (!Basket.Items.Any())
            {
                var basketModel = ViewModelFactory.CreateBasket(model, Basket);
                return(View(basketModel.ThemeViewPath("Basket"), basketModel));
            }

            var viewModel = ViewModelFactory.CreateCheckout(model, Basket, AllCountries, AllowedShipCountries);

            return(this.View(viewModel.ThemeViewPath("Checkout"), viewModel));
        }
Exemplo n.º 2
0
        /// <summary>
        /// The index <see cref="ActionResult"/>.
        /// </summary>
        /// <param name="model">
        /// The current render model.
        /// </param>
        /// <returns>
        /// The <see cref="ActionResult"/>.
        /// </returns>
        public override ActionResult Index(RenderModel model)
        {
            var viewModel = ViewModelFactory.CreateCheckout(model, Basket, AllCountries, AllowedShipCountries);

            return(this.View(viewModel.ThemeViewPath("Checkout"), viewModel));
        }