Våra sajter
Litium Studio Knowledgecenter

Knowledge Center för Litium Studio

Litium Scensum Knowledge Center

Knowledge Center för Litium Scensum

Litium Partner

Återfinns information som partner till Litium.

Support

Checkout flow

This article shows how you can program the Checkout flow. Checkout flow is a central theme in Litium Studio Ecommerce. Before you start, you should be familiar with the ECommerce order object and the plugin architecture. Basic understanding of pricing rules will also help you.

See Also In Other Articles

 

Checkout Flow

Checkout flow is the sequence of steps that need to take place to make a complete order in ECommerce. Therefore, checkout flow can be viewed as the process that convert the users shopping basket into an actual "order".

Checkout flow will consist of atleast three different sections:

  • Collecting information from user: such as personal information, delivery information, payment methods, etc. See item 3. below.
  • Collect payment from user: for example, by redirecting to a payment provider. See item 4 below.
  • Showing the order receipt to the user. See item 5 below.

Use the following diagram to understand the sequence of events. Use the links provided to go into each method to see more details.

 

1. When the "buy button" (ProductBuyButton web control in ProductCatalog) is clicked, it calls the add method of the Shopping cart. Internally, shopping cart will call the AddOrderRow() method and then order grand total is calculated  using CalculateOrderTotals() method.

2. When the user login to the website, the saved shopping cart is loaded into the session, using the LoadShoppingCart() method.
Then, AddCustomerInfo() method is called, to add the customer information into the order.
Finally, order grand total is calculated again, because items in shopping cart may have changed which would affect the order grand total.

3. In your Shopping cart page (and may be from your main page as well), you would provide a link to the user, to "Check out", which will start the actual checkout flow. First, you would collect all relavent information that are needed to process the order by using following methods.

a) Customer information using AddCustomerInfo() method
b) Delivery information using AddDelivery() method
c) Any additional information can be added using the AddAdditionalOrderInfo method. (Not shown in diagram above)
d) Additional checkout flow information can be kept in session using the CheckoutFlowInfo property in shopping cart. Using CheckoutFlowInfo property is demonstrated in the ExecutePayment  of a payment provider.

4.To Collect the money from the customer, you should show full order details to the customer, and provide a confirmation button. When the customer click the confirmation button, the order payment should be collected from him. This is done by calling the ExecutePayment() method in shopping cart.
The shopping cart will perform following actions:

  • Call the CreateOrder() method in the checkoutflow to create a order carrier,
  • Save the created order into Ecommerce orders.
  • Call ExecutePayment() method of payment provider to collect money from customer. (First PaymentInfo object of the saved orders Order::PaymentInfo collection will be used)

5.The ExecutePayment method of payment provider will initiate the process of collecting money from the customer. After this is finished, the control will be returned back to the checkout flow. Note that, depeneding on the implementation of the payment provider, this return of control can be asynchronous.
When the control returns back to Checkout flow, you should examine the payment info status to see whether payment is successful, and show the order receipt to the user (or any failure information). When the user moves away from the order receipt, you should clear the shopping cart from its current information, to make it ready to accept a new order.
 


Share this

| More

Comments made

No comments are made

You need to be logged in to make a comment

Username*  


Password*  





Create your own user account!