Working with the Checkout Web Part

The Checkout Web Part runs the configured checkout steps.

Each step of the Checkout Web Part is represented by a user control that manages that part of the checkout workflow. You can configure multiple checkout workflows. 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 R2 provides a CheckoutControl that displays the checkout steps. This is the StandardCheckoutControl.

The CheckoutFlow provider is 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 custom 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 skip steps that are not needed for the current context.

Properties

The following table describes the Checkout Web Part properties.

Property

Maps to

Type

Description

Default

"Return to cart" button URL

CartUrl

String

Sets the page URL to redirect to when the "Return to Cart" button is pressed.

Blank

Checkout flow controller class

CheckoutFlowControlClass

String

The full, assembly-qualified name of the .NET Framework class that will control the flow of the checkout process. A default implementation has been provided in the class Microsoft.Commerce.Portal.UI.Orders.WebControls.StandardCheckoutFlowControl.

Microsoft.Commerce.Portal.UI.OrdersSharePoint.WebControls.SPStandardCheckoutFlowControl, Microsoft.Commerce.Portal.UI.OrdersSharePoint, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35

Checkout flow provider class

CheckoutFlowProviderClass

String

The full, assembly-qualified name of the .NET Framework class that will provide the steps of the checkout process. Two implementations have been provided. The first is the class Microsoft.Commerce.Portal.UI.Orders.XmlCheckoutFlowProvider that provides the steps using a file such as "Checkout.xml".

The second, is the class Microsoft.Commerce.Portal.UI.OrdersSharePoint.SPCheckoutFlowProvider that provides the steps using a SharePoint list with the fields set up, for example, "CheckoutSteps".

Microsoft.Commerce.Portal.UI.OrdersSharePoint.SPCheckoutFlowProvider, Microsoft.Commerce.Portal.UI.OrdersSharePoint, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35

Checkout flow source

FlowSourceUri

String

Sets the URL of the file used to supply the checkout flow steps.

Blank

Flow Source

FlowSourceUri

String

Checkout steps

None

Cart Page

CartPageUri

String

Sets the URL of the Cart page.

/Pages/cart.aspx

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

Developing with Orders Web Parts

Checkout Web Part