function uc_cart_view_form in Ubercart 5
Same name and namespace in other branches
- 6.2 uc_cart/uc_cart.module \uc_cart_view_form()
- 7.3 uc_cart/uc_cart.module \uc_cart_view_form()
Display a page allowing the customer to view the contents of his or her cart.
Handles simple or complex objects. Some cart items may have a list of products that they represent. These are displayed but are not able to be changed by the customer.
2 string references to 'uc_cart_view_form'
- hook_cart_pane in docs/
hooks.php - Register callbacks for a cart pane.
- uc_cart_cart_pane in uc_cart/
uc_cart.module - Implementation of hook_cart_pane().
File
- uc_cart/
uc_cart.module, line 1199
Code
function uc_cart_view_form($items = NULL) {
$form['items'] = array(
'#tree' => TRUE,
);
$i = 0;
foreach ($items as $item) {
$display_item = module_invoke($item->module, 'cart_display', $item);
if (!empty($display_item)) {
$form['items'][$i] = $display_item;
$form['items'][$i]['image']['#value'] = uc_product_get_picture($display_item['nid']['#value'], 'cart');
$i++;
}
}
if (($page = variable_get('uc_continue_shopping_url', '')) != '<none>' && variable_get('uc_continue_shopping_type', 'link') == 'button') {
$form['continue_shopping'] = array(
'#type' => 'submit',
'#value' => variable_get('uc_continue_shopping_text', t('Continue shopping')),
);
}
$form['update'] = array(
'#type' => 'submit',
'#value' => t('Update cart'),
);
if (variable_get('uc_checkout_enabled', TRUE)) {
$form['checkout'] = array(
'#type' => 'submit',
'#value' => t('Checkout'),
);
}
return $form;
}