How to display order information at 'order complete' page

   —   
This article describes necessary steps which should be taken to display order information at 'order complete' page.
To achieve this functionality you can use generated ID of newly created order and pass it to the page where you redirect after completing order. Please find sample URL that you can specify into 'Default URL after purchase:' field bellow:

/SpecialPages/OrderCompleted?orderid={%OrderID%}

Then on target page you can add some custom control/web part that will acquire required data (you can use e.g. 'GetShoppingCartInfoFromOrder(int orderId)' function) and display them on the page. You can inspire by controls used in ~\CMSEcommerce\ShoppingCart\ShoppingCartPreview.ascx control to display the data.

You also shouldn’t forget to check that order belongs to actually logged in user. Otherwise someone could display data of order of someone else if he would 'guess' the orderid and manually change it in query string. For this reason we recommend not to allow anonymous users as there is no way to check that user is allowed to see the order data.


See also:

Applies to: Kentico CMS 3.1a
Share this article on   LinkedIn

Juraj Ondrus

Hi, I am the Technical support leader at Kentico. I'm here to help you use Kentico and get as much as possible out of it.