C# week November Black Friday
Black friday is here! Get up to 80 % extra points for free! More info
Only this week up to 80 % off on C# courses. 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...

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 can only be used properly by the members of our community who are working their way up to become IT professionals. Therefore, this knowledge is only available in exchange for points. 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.

Limited offer: Learn all knowledge and save money

Buy articles and tests separately one by one 990 points
Buy the course including all articles and features for an exclusive price 782 points
Currently, you have 0 points
By buying this exclusive package, you'll have access to all 34 articles in this course including exercise submitting while saving $18.71. This is a time limited offer for all articles in this course. Buy it now and gain a limited 21% discount.
You gain 782 points for adding an article to the site, or for $89.10 $70.39

Buy just this article

To access the article, you need 30 points
Currently, you have 0 points
You gain 30 points for adding an article to the site, or for $2.70

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

Buying this article gives you unlimited access to it forever. You will learn some more and help us keep giving our site maintenance which helps you and others get better futures. It's a win-win.

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

You gain points 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.

You can get points immediately using:

Credit card SMS Wire transfer
Credit card SMS Wire transfer

 

Activities (3)