Preparing a Simple Order for Checkout
If your sites support the use of only a single HardgoodShippingGroup
and a single CreditCard
for a given Order
, you can manage and expedite the pre-checkout process for Orders
using the ExpressCheckoutFormHandler
(class atg.commerce.order.purchase.ExpressCheckoutFormHandler
). ExpressCheckoutFormHandler
supports the use of a single Profile
-derived HardgoodShippingGroup
and a single Profile
-derived CreditCard
.
However, if your sites support any number or type of shipping group, or any number or type of payment group, then you must use the form handlers described in Preparing a Complex Order for Checkout. Note that the form handlers described in that section also work with simple Orders
that have a single HardgoodShippingGroup
and a single CreditCard
.
Oracle ATG Web Commerce provides an instance of ExpressCheckoutFormHandler
, which is located in Nucleus at /atg/commerce/order/purchase/ExpressCheckoutFormHandler
. The following table describes its important methods:
Method | Description |
---|
handleExpressCheckout
| This handle method first invokes the runRepricingProcess() method to reprice the Order , then calls OrderManager.updateOrder() to save the Order in its present state to the Order Repository, and finally calls commitOrder() to submit the Order for checkout. For more information on OrderManager.updateOrder() and the updateOrder pipeline that it executes, see the Updating an Order with the OrderManager subsection of Saving Orders in this chapter. |
runRepricingProcess
| Reprices the Order by running the pipeline specified in ExpressCheckoutFormHandler.repriceOrderChainId . By default, this property is set to repriceOrder . For more information on the repriceOrder pipeline, see Appendix F, Pipeline Chains. |
commitOrder
| This method first ensures that the user isn’t trying to double-submit the Order by checking if the ID of the current Order is equal to the ID of the user’s last Order (in ShoppingCart.last ). If the IDs are not equal, then the current Order can be submitted for checkout. The method then calls the OrderManager.processOrder() method, which executes the processOrder pipeline (See Checking Out an Order later in this chapter.). Finally, the method sets the submitted Order as the user’s last Order (in ShoppingCart.last ), and it constructs a new, empty Order and sets it as the user’s current Order (in ShoppingCart.current ). |
The following boolean properties of the ExpressCheckoutFormHandler
govern its behavior:
Property Name | Description |
---|
paymentGroupNeeded
| If true , then a CreditCard payment group is automatically taken from the Profile . If false , then the user can supply the CreditCard information in a form through the ExpressCheckoutFormHandler.paymentGroup property. |
shippingGroupNeeded
| If true , then a HardgoodShippingGroup is automatically taken from the Profile . If false , then the user can supply the HardgoodShippingGroup information in a form through the ExpressCheckoutFormHandler.shippingGroup property. |
commitOrder
| If true , then the ExpressCheckoutFormHandler.handleExpressCheckout () method submits the Order for checkout. You can set this property to false if you want to display a confirmation page before committing the Order . By default, this property is set to false . |
Note: Recall that, as with all shopping cart-related form handlers, empty preXXX and postXXX methods are provided so you can extend ExpressCheckoutFormHandler
, as necessary. To implement a system that requires a more complex checkout process, see Preparing a Complex Order for Checkout.
See Checking Out an Order for detailed information on the order checkout process.