Share via


Checkout Web Part

The Checkout Web Part runs the configured checkout steps.

Architecture

Each step of the Checkout Web Part is represented by a user control that manages that part of the checkout work flow. You can configure multiple checkout work flows. The following list shows some examples:

  • Standard Checkout

  • Anonymous Checkout

  • Quick/Express Checkout

The Checkout Web Part displays a wizard-like checkout flow based on the values that you configure and the settings defined in the CheckoutFlow source/provider. This Web Part does the following:

  1. Creates an instance of the CheckoutFlowControl.

  2. Sets the FlowSourceProvider to the CheckoutFlowControl.

  3. Sets the FlowSourceUri to the CheckoutFlowControl.

  4. Renders the CheckoutFlowControl.

The CheckoutFlowControl is an abstract class that is derived from the Composite Control. The CheckoutFlowControl is the container for the various checkout controls. The role of the container is to render the surrounding user interface, such as a Progress tab on top to display where the shopper is currently is in the checkout flow, and to render the appropriate checkout control. Commerce Server 2009 provides a CheckoutControl that displays the checkout steps This is the StandardCheckoutControl.

The CheckoutFlow provider responsible for loading the configured checkout, which is a list of CheckoutItem. The XML CheckoutFlow provider reads the configured steps in an XML file.

You can implement and use a custom checkout flow provider. This new provider would be derived from the abstract class CheckoutFlowProvider. An example of this could be to store the checkout flow in a SharePoint list.

You implement each step of checkout flow as a user control. These controls are derived from a base CheckoutControl class. This allows for quick access to the CheckoutFlowControl container instance and ShoppingController from the checkout control.

In some cases, you will only need to display one or many steps of the checkout flow if certain conditions are met. You achieve this by deriving you own CheckoutFlowProvider and overriding the GetPreviousItem and GetNextItem methods. By default, these two methods simply return the previous or next items in the list. By overriding these methods, you can alter the behavior to the skip steps that are not needed for the current context.

Properties

The following table lists the mapping of the properties for the Checkout Web Part.

Property

Maps to

"Return to cart" button URL

CartUrl

Checkout flow controller class

CheckoutFlowControlClass

Checkout flow provider class

CheckoutFlowProviderClass

Checkout flow source

FlowSourceUri

Customization

You can customize the Checkout Web Part.

You implement each checkout control as a user control. You can customize the XML CheckoutFlowProvider source file without a recompile to the core components.

Error Handling

There is no design-time error handing required for this Web Part.

API Dependencies

The dependencies on the API are:

  • Basic operations relating to the Basket commerce entity and related items:

    • Create/modify/delete/retrieve line items

    • Create/modify/delete/retrieve addresses

    • Create/modify/delete/retrieve payments

    • Create/modify/delete/retrieve promotion codes

    • Retrieve shipments

    • Retrieve discounts

  • Retrieve available payment methods

  • Retrieve available shipping methods

See Also

Other Resources

Developing with SharePoint Commerce Services

Orders System Web Parts

Working With the Checkout Web Part