The checkout form for Ubercart is a compilation of enabled checkout panes and some default controls. Checkout pane can be used to display order information, collect data from the customer, or interact with other panes. Panes are defined in enabled modules with hook_checkout_pane() and displayed and processed through specified callback functions. Some of the settings for each pane are configurable from the checkout settings pagewith defaults being specified in the hooks.
The default panes are defined in uc_cart.module in the function uc_cart_checkout_pane(). These include panes to display the contents of the shopping cart and to collect essential site user information, a shipping address, a payment address, and order comments. Other included modules offer panes for shipping and payment purposes as well.
Please note that as of Ubercart Alpha 7c, the checkout pane API has been updated. Modules developed prior to that release that defined custom checkout panes will not function properly until they are updated to the new system. You can check out this thread for information on the changes.
Checkout Pane Builder Functions
The meat of a checkout pane is its builder function. These can use any naming convention so long as the function is referenced properly in the hook_checkout_pane, but Übercart uses uc_checkout_pane_pane ID. The function will be called at various times during checkout to build and process the pane and should accept the arguments $op, $arg1, and $arg2. An example function definition from uc_cart.module is:
<?php
function uc_checkout_pane_delivery($op, $arg1, $arg2)
?>The builder function should consist of a switch statement on $op to detect what information is being requested by Übercart. This function may be called with the following strings in $op:
- view - Called to display the pane on the checkout screen. Expected to return a pane object with the attribute fields set to be an array of form elements. $arg1 is the current order object if it exists.
- review - Called to display a review of the pane's information the order review screen when checking out. Expected to return a string containing HTML output that will be dropped into a div. $arg1 is the current order object.
- process - Called when the temporary order is created during checkout after the customer continues from the checkout screen and before the review screen is displayed. No return is expected. $arg1 is a reference to the current order object. (So, by modifying $arg1 in the process block, you are modifying the actual order.) $arg2 is the contents of the array of the submitted form information for that pane.
For an example implementation of hook_checkout_pane() and the whole saving/loading process of data collected on the pane, check out the Lead Tracker contribution. Notice that you must implement hook_order() to save/load information collected in a pane, and you must implement hook_order_pane() to display the information on the order screens.

