hook_cart_pane($items)
ubercart/docs/hooks.php, line 218
Register callbacks for a cart pane.
The default cart view page displays a table of the cart contents and a few simple form features to manage the cart contents. For a module to add information to this page, it must use hook_cart_pane to define extra panes that may be ordered to appear above or below the default information.
The body gets printed to the screen if it is on the cart view page. For the settings page, the body field is ignored. You may want your function to check for a NULL argument before processing any queries or foreach() loops.
$items The current contents of the shopping cart.
The function is expected to return an array of pane arrays with the following keys:
| Name | Description |
|---|---|
| Hooks | Allow modules to interact with the Drupal core. |
<?php
function hook_cart_pane($items) {
$panes[] = array(
'id' => 'cart_form',
'title' => t('Default cart form'),
'enabled' => TRUE,
'weight' => 0,
'body' => !is_null($items) ? drupal_get_form('uc_cart_view_form', $items) : '',
);
return $panes;
}
?>