Get up to 80 % extra points for free! More info:

Lesson 24 - E-shop in ASP.NET Core MVC - Order Completion Wizard

In the previous lesson, E-shop in ASP.NET Core MVC - Finishing the Shopping Cart, we already prepared an HtmlHelper extension and basic methods for the first part of the order completion wizard, which is the cart administration. In today's ASP.NET Core tutorial, we're going to introduce other parts of the wizard and start implementing the controller and views.

The Order Completion Wizard

The order completion wizard will have three or four parts.

Cart Administration

In this part, the user will be able to change the quantity of individual products in the cart before they buy them, or remove some items from the cart.

Cart administration of an ASP.NET Core MVC e-shop

The meanings of the buttons are:

  • Refresh - After any changes in the quantities, we send the new data to the server and display the updated values (it might be worth using AJAX here and recalculate immediately after each change, but we'll show it later)
  • Continue shopping - Allows the user to leave the order completion wizard and continue shopping.
  • To checkout - Moves to the next step of the wizard. Signed-in users will be taken straight to choosing the shipping method, the unregistered ones will first have to enter their details needed to finish the order.

Viewmodel

What data do we need to send to the view? The current product list and order summary should be enough for us. We can create a simple viewmodel for that:

public class OrderIndexViewModel
{
    public IEnumerable<OrderItemInfo> OrderItems { get; set; }
    public OrderSummary OrderSummary { get; set; }
}

Controller

Let's add a new controller named


 

...End of the preview...
Continue further

You will gain knowledge worth hundreds of thousands for a few crowns

You've come here and that's great! We believe that the first lessons showed you something new and useful
Do you want to continue the course? Go to the premium section.

Buy this course

Buy all currently available lessons with exercise submitting and other features for just $89.10
Current account balance $0
By buying this package, you'll have access to all 34 articles (34 lessons) in this course.

Before buying this article, you have to buy the previous one

This article is licensed: Premium no-reselling II, by buying this article, you agree with the terms of use.

Commercial article (licence no-reselling)

Commercial article (licence no-reselling)

This article is based on many years of experience in the IT field, and describes how to develop a professional commercial product or parts, that can be directly used to generate profit or to get as a gate into the industry.

This knowledge is only for the members of our community who are working their way up to become IT professionals. Therefore, this knowledge is only available in exchange for credits. You can use the source code from this article for one commercial project. However, you will not be able to resell it. Simply put, you can't buy our article once and then sell our code multiple times. If you need to use this code a bit more extensively, we are ready to discuss Commercial licence options with you. You can find more info on this in the following article Licence.

Are you ready to become a professional? All you have to do is click here!.

Article description

Requested article covers this content:

We begin implementing the order completion wizard in ASP.NET. We'll create a controller, viewmodel, view for the first step prepare the next one.

You gain credits by supporting our network. This is done by sending a helpful amount of money to support the site, or by creating content for the network.

Article has been written for you by Martin Petrovaj
Avatar
Activities