<?php
hook_cart_pane($items)
?>Description:
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.
Parameters:
- $items - The current contents of the shopping cart.
Return value:
The function is expected to return an array of pane arrays with the following keys:
| Key | Type | Value |
| id | string | The internal ID of the pane, using a-z, 0-9, and - or _. |
| title | string | The name of the cart pane displayed to the user. Use t(). |
| enabled | boolean | Whether the pane is enabled by default or not. (Defaults to TRUE.) |
| weight | integer | The weight of the pane to determine its display order. (Defaults to 0.) |
| body | string | The body of the pane when rendered on the cart view screen. |
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.
Example:
<?php
function uc_cart_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;
}
?>
