Ok, this thread will be for development instructions and questions related to the new Checkout Panes API. There are still some changes I'd like to make to the default checkout panes, but I'm going to halt my activity to start testing an Alpha 7c release. For more information on that, please follow this thread.
Now, about the changes. The previous API (consisting of hook_checkout_pane() and associated callback functions) relied on developers to use some sort of half-done pseudo-OOP functions I wrote. I have no excuse.
It was the first API I wrote for Ubercart and bound to be the weirdest. That is now all being handled by the checkout form builder, along with the continue buttons when necessary.
What remains unchanged is the fact that checkout panes must be defined in a hook_checkout_pane() function. The callbacks should still consist of a switch using different $op values to return different data. However, the view $op now expects a different return value. It should be an array using the following keys:
- description - string The default description text displayed in the pane's fieldset. Defaults to NULL.
- contents - array An array of form elements added as children to the pane's fieldset. Defaults to NULL.
- theme - string The name of a themable function used to render the fieldset on the form. This is not the actual function name, but rather a title of sorts (like address_pane). The function name in your module should be the themable name preceded by theme_ (like theme_address_pane() in uc_cart_checkout_pane.inc). Defaults to NULL.
- next-button - boolean Set the value to FALSE if you this is a pane that cannot be collapsed and should not receive a Next button if the store owner is using collapsible panes. Defaults to TRUE.
Also, I have taken out the theme $op. It was a silly idea that resulted in bad, duplicate code in the billing and delivery address panes and made it difficult for folks to theme their custom panes if they wanted to. This has been further integrated w/ the Forms API to use a themable function as mentioned above.
Because the form structure has changed, you will need to update your process $op as well. Before I was passing in a lot more of the form object for processing checkout panes. Now I'm just passing in the values for elements in that pane's fieldset, so you can get values like this (from the customer pane):
<?php
$arg1->primary_email = $arg2['primary_email'];
?>The arguments for callback functions are the same as before. It should be:
<?php
function uc_checkout_pane_delivery($op, &$arg1, $arg2) {
/**
* $op can be view, process, or review.
* &$arg1 will always be the current order object.
* $arg2 is only used for the process $op and contains this pane's
* form values from the checkout form.
*/
}
?>The new code cleans out a lot of div/class pollution on the checkout page. I believe I have corrected a Javascript problem or two, but I know others probably still exist. Feel free to point them out.
Oh! I still need to revise the review page. It's just not pretty. I'm itching for ideas here, so bring them on. 
This code is running on the Livetest and will be uploaded to the Bazaar repository shortly. You can see a new JS feature regarding collapsible panes in action at the moment, too. I'll let folks know when to start testing and what sort of feedback I need in the previous announcement thread. The documentation will be updated soon.
Click here to view the Bazaar version of the new checkout pane include file.




Joined: 08/07/2007