Store order summary in database
This step of the Checkout Wizard allows you to specify where you want information to be inserted into your database, for each transaction made on your site.
eCart 5 now includes the ability to create the necessary database tables and columns for you. To do this, choose the Create from preset checkbox, and choose the appropriate preset.
Note: In most cases, you will want to choose the Default option, this will create the necessary tables and columns without any interaction from you. If you are modifying PowerStore, a PowerStore preset is provided for you to choose.
Databases typically use two tables to handle orders, an Orders table and an OrderDetails table. These two tables are linked by key field, usually OrderID; each record in the OrderDetails table includes a column called something like DetailsOrderID that corresponds to the OrderID column in the Orders table.Configuring these settings manually
The Store Cart Summary in Database server behavior adds records to the more general Orders table. This server behavior is used together with the Store Cart Details in Database server behavior configured in the next step to save all the cart information at the same time.
If you wish to configure order insertion in the database through the Checkout Wizard, you will need to set up your database connection and corresponding order tables in the database prior to accessing the Checkout Wizard.
To configure storing the order summary:
- Leave the "No thanks..." field unchecked. To bypass this step and order management configuration, check this box and click the Next button. Otherwise proceed with the configuration process.
- Select the desired connection from the Connection list.
- Choose a table to insert the shopping cart information into from the Table list.
The table chosen should have, at a minimum, columns for an order ID (the unique key field) and order total.
Other useful columns include ones for an order reference ID, a user ID, the shipping amount and the tax on the order. - Select the key field for the table from the Unique ID list.
- Bind values to the table columns listed in the columns area. Either static or dynamic values can be used.
To bind a static value, enter it in the Value field for a selected column.
To bind a dynamic value, choose the lightning bolt to open the Dynamic Data dialog box and select an item from a shopping cart entry; click OK to close the Dynamic Data dialog.
Dynamic values can also be entered by hand in the Value field.
In the example figure, the following values are assigned:- OrderID - Left blank and not updated. OrderID is an autonumber field.
- OrderReferenceID - Choose [Cart ID] from the shopping cart dynamic data entry. The code appropriate to your server model is written to include the SessionID, a unique value.
- OrderUserID - In this example, the user has logged in and his unique user ID has been assigned to a session variable, UserID. The code for writing this session variable appropriate to the server model has been entered manually into the Value field and the binding updated.
- OrderShipping - Shipping is retrieved from the eCart object data binding for the shipping value in the cart.
- OrderTax - Tax is retrieved from the eCart object data binding for the tax value in the cart.
- OrderTotal - From the shopping cart entry of the Dynamic Data dialog, the [GrandTotal] item is selected and the appropriate code is written.
- Click Next when you're done to proceed to configuration of insertion of the order details in the database.