hook_order_pane

Function hook_order_pane() in uc_order.module:

<?php
  hook_order_pane
()
?>


Description:

This hook is used to add panes to the order viewing and administration screens. The default panes include areas to display and edit addresses, products, comments, etc. Developers should use this hook when they need to display or modify any custom data pertaining to an order. For example, a store that uses a custom checkout pane to find out a customer's desired delivery date would then create a corresponding order pane to show the data on the order screens.

hook_order_pane() works by defining new order panes and providing a little bit of information about them. View the return value section below for information about what parts of an order pane are defined by the hook.

The real meat of an order pane is its callback function (which is specified in the hook). The callback function handles what gets displayed on which screen and what data can be manipulated. That is all somewhat out of the scope of this API page, so you'll have to click here to read more about what a callback function should contain.

Return value:

The function should return an array of associative arrays representing the order panes your modules defines. These arrays should contain the following key/value combinations:

Key Type Value
id string The internal ID of the order pane.
callback string Name of the order pane's callback function, called for various operations.
title string
desc string
class string
weight integer
show array

Example:

<?php
/**
* Implementation of hook_order_pane().
*/
function uc_payment_order_pane() {
 
$panes[] = array(
   
'id' => 'payment',
   
'callback' => 'uc_order_pane_payment',
   
'title' => t('Payment'),
   
'desc' => t('Specify and collect payment for an order.'),
   
'class' => 'pos-left',
   
'weight' => 4,
   
'show' => array('view', 'edit', 'customer'),
  );
  return
$panes;
}
?>