In order to store the values entered in the UI fields that you have created in the previous step, you have to create custom fields for the CartOrder and Order objects. During the checkout process a CartOrder object is used to gather the information and preserve it in the database.
NOTE: Ecommerce order data is stored in multiple tables. During the checkout process this data is stored in “Cart” tables. These tables act like a temporary buffer to hold all of the information that a customer will enter during the multiple step check out process (shipping address, billing address, selected shipping method, payment method, coupon codes, etc.). Once a customer chooses to actually purchase the items in their cart, the contents of the “Cart” tables are then copied to the similarly named “Order” tables.
Because you will only want to attempt to modify the database structure once, a good place to perform this action is in the Application_Start event handler in the Global.asax file. By default, a new SitefinityWebApp project does not include this file so you will need to add a new Global.asax file to your project. In the Application_Start handler, hook up to the Bootstrapped event of the Bootstrapper class. This event occurs when the first instance of your Sitefinity CMS site is requested.
To create the fields, you will be using a method named CreateCustomOrderFields(). This method must perform the following:
To create the custom fields for the CartOrder and Order objects, you must perform the following.
Use the following code sample:
Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.
This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.
This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important