User Guide
Shopping Cart Reference 175
Insert [ShoppingCart] in [Recordset] when [button] is clicked
using OrderID from [HiddenFormElement]
This contract is an interaction between a basement ShoppingCart element, a
submit button, a Hidden Form Element and the destination Recordset for the
Cart data. This contract can be used when the order information is submitted
on a previous page and redirected to a confirmation page, where the OrderID
generated from the previous page is assigned to a form element. The confirmation
page then submits the cart items as order details using the OrderID from the
form element.
Note: Note: This contract can be used in conjunction with contracts that generate an
OrderID needed for an OrderDetails record (such as the 'Insert order in [recordset]...' and
"Replace [token] in [target] with unique OrderID contracts).
When the button is clicked, the shopping cart data is inserted into the orders
database where each item is an 'order detail'. The "Go To Page" parameter allows
you to redirect to the specified page after the insert is completed.
Parameters:
OrderIDCol is the name of the OrderID column in the target recordset.
SuccessRedirect specifies the target page for redirecting after Cart contents are
successfully added to the database.
FailedRedirect specifies the target page for redirecting if the cart data was not
successfully inserted in the database. This allows you to display an error
message for the user so they'll know the order couldn't be placed.
Participants:
ShoppingCart
Recordset
HiddenFormElement
Button (any clickable object)