'Cart settings',
'description' => 'Configure the cart settings.',
'page callback' => 'uc_cart_cart_settings_overview',
'access arguments' => array('administer store'),
'file' => 'uc_cart.admin.inc',
);
$items['admin/store/settings/cart/overview'] = array(
'title' => 'Overview',
'description' => 'View the cart settings.',
'access arguments' => array('administer store'),
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
);
$items['admin/store/settings/cart/edit'] = array(
'title' => 'Edit',
'description' => 'Edit the cart settings.',
'page callback' => 'drupal_get_form',
'page arguments' => array('uc_cart_cart_settings_form'),
'access arguments' => array('administer store'),
'type' => MENU_LOCAL_TASK,
'weight' => -5,
'file' => 'uc_cart.admin.inc',
);
$items['admin/store/settings/cart/edit/basic'] = array(
'title' => 'Cart settings',
'description' => 'Edit the basic cart settings.',
'access arguments' => array('administer store'),
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
);
$items['admin/store/settings/cart/edit/panes'] = array(
'title' => 'Cart panes',
'description' => 'Edit the pane settings for the cart view page.',
'page callback' => 'drupal_get_form',
'page arguments' => array('uc_cart_cart_panes_form'),
'access arguments' => array('administer store'),
'type' => MENU_LOCAL_TASK,
'weight' => -5,
'file' => 'uc_cart.admin.inc',
);
$items['admin/store/settings/cart/edit/block'] = array(
'title' => 'Cart block',
'description' => 'Edit the settings for the shopping cart block.',
'page callback' => 'uc_cart_block_edit_info',
'access arguments' => array('administer store'),
'type' => MENU_LOCAL_TASK,
'weight' => 0,
'file' => 'uc_cart.admin.inc',
);
$items['admin/store/settings/checkout'] = array(
'title' => 'Checkout settings',
'description' => 'Configure the checkout settings.',
'page callback' => 'uc_cart_checkout_settings_overview',
'access arguments' => array('administer store'),
'file' => 'uc_cart.admin.inc',
);
$items['admin/store/settings/checkout/overview'] = array(
'title' => 'Overview',
'description' => 'View the checkout settings.',
'access arguments' => array('administer store'),
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
'file' => 'uc_cart.admin.inc',
);
$items['admin/store/settings/checkout/edit'] = array(
'title' => 'Edit',
'description' => 'Edit the cart settings.',
'page callback' => 'drupal_get_form',
'page arguments' => array('uc_cart_checkout_settings_form'),
'access arguments' => array('administer store'),
'type' => MENU_LOCAL_TASK,
'weight' => -5,
'file' => 'uc_cart.admin.inc',
);
$items['admin/store/settings/checkout/edit/basic'] = array(
'title' => 'Checkout settings',
'description' => 'Edit the basic checkout settings.',
'access arguments' => array('administer store'),
'type' => MENU_DEFAULT_LOCAL_TASK,
'weight' => -10,
);
$items['admin/store/settings/checkout/edit/panes'] = array(
'title' => 'Checkout panes',
'description' => 'Edit the pane settings for the checkout page.',
'page callback' => 'drupal_get_form',
'page arguments' => array('uc_cart_checkout_panes_form'),
'access arguments' => array('administer store'),
'type' => MENU_LOCAL_TASK,
'weight' => -5,
'file' => 'uc_cart.admin.inc',
);
$items['admin/store/settings/checkout/edit/messages'] = array(
'title' => 'Checkout messages',
'description' => 'Edit the messages for the checkout completion page.',
'page callback' => 'drupal_get_form',
'page arguments' => array('uc_cart_checkout_messages_form'),
'access arguments' => array('administer store'),
'type' => MENU_LOCAL_TASK,
'weight' => 0,
'file' => 'uc_cart.admin.inc',
);
$items['admin/store/settings/checkout/edit/fields'] = array(
'title' => 'Address fields',
'description' => 'Edit the address field settings.',
'page callback' => 'drupal_get_form',
'page arguments' => array('uc_store_address_fields_form'), // missing?
'access arguments' => array('administer store'),
'type' => MENU_LOCAL_TASK,
'weight' => 5,
'file' => 'uc_cart.admin.inc',
);
$items['cart'] = array(
'title' => 'Shopping cart',
'description' => 'View/modify the contents of your shopping cart or proceed to checkout.',
'page callback' => 'uc_cart_view',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
'file' => 'uc_cart.pages.inc',
);
$items['cart/checkout'] = array(
'title' => 'Checkout',
'description' => 'Purchase the items in your shopping cart.',
'page callback' => 'uc_cart_checkout',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
'file' => 'uc_cart.pages.inc',
);
$items['cart/checkout/review'] = array(
'title' => 'Review order',
'description' => 'Review an order before final submission.',
'page callback' => 'uc_cart_checkout_review',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
'file' => 'uc_cart.pages.inc',
);
$items['cart/checkout/complete'] = array(
'title' => 'Order complete',
'description' => 'Display information upon completion of an order.',
'page callback' => 'uc_cart_checkout_complete',
'access arguments' => array('access content'),
'type' => MENU_CALLBACK,
'file' => 'uc_cart.pages.inc',
);
return $items;
}
/**
* Implementation of hook_imagecache_default_presets().
*/
function uc_cart_imagecache_default_presets() {
$presets = array();
$presets['cart'] = array(
'presetname' => 'cart',
'actions' => array(
array(
'weight' => '0',
'module' => 'uc_cart',
'action' => 'imagecache_scale',
'data' => array(
'width' => '50',
'height' => '50',
'upscale' => 0,
),
),
),
);
return $presets;
}
/**
* Implementation of hook_theme().
*/
function uc_cart_theme() {
return array(
'uc_cart_block_title' => array(
'arguments' => array('title' => NULL, 'icon_class' => FALSE, 'collapsible' => FALSE),
),
'uc_cart_block_title_icon' => array(
'arguments' => array('icon_class' => NULL),
),
'uc_cart_block_content_cachable' => array(
'arguments' => array(),
),
'uc_cart_block_content' => array(
'arguments' => array('help_text' => NULL, 'items' => NULL, 'item_count' => NULL, 'item_text' => NULL, 'total' => NULL, 'summary_links' => NULL),
),
'uc_cart_block_items' => array(
'arguments' => array('items' => NULL),
),
'uc_cart_block_summary' => array(
'arguments' => array('item_count' => NULL, 'item_text' => NULL, 'total' => NULL, 'summary_links' => NULL),
),
'uc_empty_cart' => array(
'arguments' => array(),
),
'uc_cart_view_form' => array(
'arguments' => array('form' => NULL),
),
'uc_cart_view_price' => array(
'arguments' => array('form' => NULL),
),
'address_pane' => array(
'arguments' => array('form' => NULL),
),
'cart_review_table' => array(
'arguments' => array('show_subtotal' => TRUE),
),
'uc_cart_checkout_form' => array(
'arguments' => array('form' => NULL),
'file' => 'uc_cart.pages.inc',
),
'uc_cart_checkout_review' => array(
'arguments' => array('panes' => NULL, 'form' => NULL),
'file' => 'uc_cart.pages.inc',
),
'uc_cart_complete_sale' => array(
'arguments' => array('message' => ''),
),
);
}
/**
* Implementation of hook_init().
*/
function uc_cart_init() {
global $conf;
$conf['i18n_variables'][] = 'uc_cart_breadcrumb_text';
$conf['i18n_variables'][] = 'uc_cart_help_text';
$conf['i18n_variables'][] = 'uc_cart_new_account_details';
$conf['i18n_variables'][] = 'uc_checkout_instructions';
$conf['i18n_variables'][] = 'uc_checkout_review_instructions';
$conf['i18n_variables'][] = 'uc_continue_shopping_text';
$conf['i18n_variables'][] = 'uc_minimum_subtotal_text';
$conf['i18n_variables'][] = 'uc_msg_continue_shopping';
$conf['i18n_variables'][] = 'uc_msg_order_existing_user';
$conf['i18n_variables'][] = 'uc_msg_order_logged_in';
$conf['i18n_variables'][] = 'uc_msg_order_new_user';
$conf['i18n_variables'][] = 'uc_msg_order_submit';
}
/**
* Implementation of hook_cron().
*/
function uc_cart_cron() {
// Empty anonymous carts.
$time = strtotime(variable_get('uc_cart_anon_duration', '4') .' '. variable_get('uc_cart_anon_unit', 'hours') .' ago');
$result = db_query("SELECT DISTINCT cart_id FROM {uc_cart_products} WHERE changed <= %d AND CHAR_LENGTH(cart_id) > 8", $time);
while ($row = db_fetch_object($result)) {
uc_cart_empty($row->cart_id);
}
// Empty authenticated carts.
$time = strtotime(variable_get('uc_cart_auth_duration', '1') .' '. variable_get('uc_cart_auth_unit', 'years') .' ago');
$result = db_query("SELECT DISTINCT cart_id FROM {uc_cart_products} WHERE changed <= %d AND CHAR_LENGTH(cart_id) <= 8", $time);
while ($row = db_fetch_object($result)) {
uc_cart_empty($row->cart_id);
}
}
/**
* Implementation of hook_exit().
*
* Code from CacheExclude - http://drupal.org/project/cacheexclude
*/
function uc_cart_exit() {
global $base_root;
$pages = array('cart', 'cart/checkout', 'cart/checkout/review', 'cart/checkout/complete');
$this_page = request_uri();
foreach ($pages as $page) {
if ($page && strstr($this_page, $page) !== FALSE) {
cache_clear_all($base_root . $this_page, 'cache_page');
return;
}
}
}
/**
* Implementation of hook_nodeapi().
*/
function uc_cart_nodeapi(&$node, $op, $arg3, $arg4) {
if (uc_product_is_product($node->type)) {
switch ($op) {
case 'delete':
db_query("DELETE FROM {uc_cart_products} WHERE nid = %d", $node->nid);
break;
}
}
}
/**
* Implementation of hook_user().
*/
function uc_cart_user($op, &$edit, &$user, $category = NULL) {
switch ($op) {
case 'load':
// Fall through if this a new user load prior to checkout.
if (request_uri() != '/user/register?destination=cart/checkout' || $user->uid == 0) {
break;
}
case 'login':
// Add items from an anonymous cart to a user's permanent cart on login.
uc_cart_login_update($user->uid);
break;
}
}
/**
* Implementation of hook_form_alter().
*/
function uc_cart_form_alter(&$form, $form_state, $form_id) {
global $language;
// Redirect shopper back to checkout page if they go to login from there.
if ($form_id == 'user_login' || $form_id == 'user_edit' || $form_id == 'user_register') {
// Figure out the destination.
if (empty($_SESSION['checkout-redirect'])) {
// Compare the referer to checkout page URLs.
if (uc_referer_check('cart/checkout') && uc_referer_uri() != '') {
$_SESSION['checkout-redirect'] = TRUE;
}
elseif (uc_referer_check(array('cart/checkout/review', 'cart/checkout/complete')) && uc_referer_uri() != '') {
unset($_SESSION['checkout-redirect']);
}
}
if (!empty($_SESSION['checkout-redirect'])) {
$form['#redirect'] = 'cart/checkout';
}
}
if ($form_id == 'user_login' || $form_id == 'user_login_block') {
$form['#submit'] = array_merge(array('uc_cart_user_login_form_submit'), (array) $form['#submit']);
}
}
/**
* Implementation of hook_block().
*/
function uc_cart_block($op = 'list', $delta = 0, $edit = array()) {
global $user;
switch ($op) {
case 'list':
$blocks = array();
// TODO: Add sensible default settings for the cart block based on the
// docs at http://api.drupal.org/api/function/hook_block/6.
$blocks[0] = array(
'info' => t('Shopping cart'),
'cache' => BLOCK_NO_CACHE,
);
return $blocks;
case 'configure':
// 0 = Default shopping cart block.
if ($delta == 0) {
return uc_cart_block_settings_form();
}
break;
case 'save':
// 0 = Default shopping cart block.
if ($delta == 0) {
uc_cart_block_settings_form_submit($edit);
}
break;
case 'view':
// 0 = Default shopping cart block.
if ($delta == 0) {
$cachable = !$user->uid && variable_get('cache', CACHE_DISABLED) != CACHE_DISABLED;
$uc_cart_path = drupal_get_path('module', 'uc_cart');
$product_count = count(uc_cart_get_contents());
// Display nothing if the block is set to hide on empty and there are no
// items in the cart.
if (!$cachable && variable_get('uc_cart_block_empty_hide', FALSE) && !$product_count) {
return;
}
// Add the cart block CSS.
drupal_add_css(drupal_get_path('module', 'uc_cart') .'/uc_cart_block.css');
// If the block is collapsible, add the appropriate JS.
if (!$cachable && variable_get('uc_cart_block_collapsible', TRUE)) {
drupal_add_js(array('ucCollapsedBlock' => variable_get('uc_cart_block_collapsed', TRUE)), 'setting');
drupal_add_js(drupal_get_path('module', 'uc_cart') .'/uc_cart_block.js');
$collapsible = TRUE;
}
else {
$collapsible = FALSE;
}
// Hack in some CSS to hide the block if necessary. drupal_add_css() is in Drupal 7 for this...
if (variable_get('uc_cart_block_collapsed', TRUE)) {
drupal_set_html_head("");
}
// Build the cart image if enabled.
if (variable_get('uc_cart_block_image', TRUE)) {
// If the cart is empty or we need a cachable cart block...
if ($cachable || !$product_count) {
// Use the "empty" cart icon.
$icon_class = 'cart-block-icon-empty';
}
else {
// Otherwise use the "full" cart icon.
$icon_class = 'cart-block-icon-full';
}
}
else {
$icon_class = FALSE;
}
// Set the text of the block title.
$title = check_plain(trim(variable_get('uc_cart_block_title', '')));
if (empty($title)) {
$title = t('Shopping cart');
}
// Build the block array for display based on cache settings.
if ($cachable) {
// Caching is turned on and the user is not logged in, so we should
// deliver a block that is safe for caching.
$block = array(
'subject' => theme('uc_cart_block_title', $title, $icon_class, $collapsible),
'content' => theme('uc_cart_block_content_cachable'),
);
}
else {
// Otherwise build the whole shebang.
// First build the help text.
$help_text = FALSE;
if (variable_get('uc_cart_show_help_text', FALSE) && ($text = variable_get('uc_cart_help_text', t('Click title to display cart contents.')))) {
$help_text = check_plain($text);
}
$items = FALSE;
$item_count = 0;
$total = 0;
if ($product_count) {
foreach (uc_cart_get_contents() as $item) {
$display_item = module_invoke($item->module, 'cart_display', $item);
if (!empty($display_item)) {
$items[] = array(
'nid' => $display_item['nid']['#value'],
'qty' => t('@qty×', array('@qty' => $display_item['qty']['#default_value'])),
'title' => $display_item['title']['#value'],
'price' => $display_item['#total'],
'desc' => isset($display_item['description']['#value']) ? $display_item['description']['#value'] : FALSE,
);
}
$item_count += $item->qty;
$total += $display_item['#total'];
}
}
// Build the item count text and cart links.
$item_text = format_plural($item_count, '@count Item', '@count Items');
$summary_links = array(
'cart-block-view-cart' => array(
'title' => t('View cart'),
'href' => 'cart',
'attributes' => array('rel' => 'nofollow'),
),
);
// Only add the checkout link if checkout is enabled.
if (variable_get('uc_checkout_enabled', TRUE)) {
$summary_links['cart-block-checkout'] = array(
'title' => t('Checkout'),
'href' => 'cart/checkout',
'attributes' => array('rel' => 'nofollow'),
);
}
$block = array(
'subject' => theme('uc_cart_block_title', $title, $icon_class, $collapsible),
'content' => theme('uc_cart_block_content', $help_text, $items, $item_count, $item_text, $total, $summary_links),
);
}
return $block;
}
break;
}
}
/**
* Build the settings form used by the shopping cart block.
*
* @ingroup forms
* @see uc_cart_block_settings_form_submit()
*/
function uc_cart_block_settings_form() {
$form = array();
$form['uc_cart_block_empty_hide'] = array(
'#type' => 'checkbox',
'#title' => t('Hide block if cart is empty.'),
'#default_value' => variable_get('uc_cart_block_empty_hide', FALSE),
);
$form['uc_cart_block_image'] = array(
'#type' => 'checkbox',
'#title' => t('Display the shopping cart icon in the block title.'),
'#default_value' => variable_get('uc_cart_block_image', TRUE),
);
$form['uc_cart_block_title'] = array(
'#type' => 'textfield',
'#title' => t('Cart name'),
'#description' => t('This name will be displayed when using the default block title.
Leaving this blank defaults to the translatable name "Shopping Cart."'),
'#default_value' => variable_get('uc_cart_block_title', ''),
);
$form['uc_cart_block_collapsible'] = array(
'#type' => 'checkbox',
'#title' => t('Make the shopping cart block collapsible by clicking the name or arrow.'),
'#default_value' => variable_get('uc_cart_block_collapsible', TRUE),
);
$form['uc_cart_block_collapsed'] = array(
'#type' => 'checkbox',
'#title' => t('Display the shopping cart block collapsed by default.'),
'#default_value' => variable_get('uc_cart_block_collapsed', TRUE),
);
$form['uc_cart_show_help_text'] = array(
'#type' => 'checkbox',
'#title' => t('Display small help text in the shopping cart block.'),
'#default_value' => variable_get('uc_cart_show_help_text', FALSE),
);
$form['uc_cart_help_text'] = array(
'#type' => 'textfield',
'#title' => t('Cart help text'),
'#description' => t('Displayed if the above box is checked.'),
'#default_value' => variable_get('uc_cart_help_text', t('Click title to display cart contents.')),
'#size' => 32,
);
return $form;
}
/**
* Save the shopping cart block settings.
*
* @see uc_cart_block_settings_form()
*/
function uc_cart_block_settings_form_submit($edit = array()) {
variable_set('uc_cart_block_empty_hide', $edit['uc_cart_block_empty_hide']);
variable_set('uc_cart_block_image', $edit['uc_cart_block_image']);
variable_set('uc_cart_block_title', $edit['uc_cart_block_title']);
variable_set('uc_cart_block_collapsible', $edit['uc_cart_block_collapsible']);
variable_set('uc_cart_block_collapsed', $edit['uc_cart_block_collapsed']);
variable_set('uc_cart_show_help_text', $edit['uc_cart_show_help_text']);
variable_set('uc_cart_help_text', $edit['uc_cart_help_text']);
}
/**
* Theme the shopping cart block title
*
* @param $title
* The text to use for the title of the block.
* @param $icon_class
* Class to use for the cart icon image or FALSE if the icon is disabled.
* @param $collapsible
* TRUE or FALSE indicating whether or not the cart block is collapsible.
* @ingroup themeable
*/
function theme_uc_cart_block_title($title, $icon_class = 'cart-empty', $collapsible = TRUE) {
$output = '';
// Add in the cart image if specified.
if ($icon_class) {
$output .= theme('uc_cart_block_title_icon', $icon_class);
}
// Add the main title span and text, with or without the arrow based on the
// cart block collapsibility settings.
if ($collapsible) {
$output .= ' ';
}
else {
$output .= ' ';
}
return $output;
}
/**
* Theme the shopping cart icon.
*
* @param $icon_class
* Class to use for the cart icon image, either cart-full or cart-empty.
* @ingroup themeable
*/
function theme_uc_cart_block_title_icon($icon_class) {
return l('', 'cart', array('html' => TRUE));
}
/**
* Theme the cachable shopping cart block content.
*
* @ingroup themeable
*/
function theme_uc_cart_block_content_cachable() {
return t('View your shopping cart.', array('!url' => url('cart')));
}
/**
* Theme the shopping cart block content.
*
* @param $help_text
* Text to place in the small help text area beneath the cart block title or
* FALSE if disabled.
* @param $items
* An associative array of item information containing the keys 'qty',
* 'title', 'price', and 'desc'.
* @param $item_count
* The number of items in the shopping cart.
* @param $item_text
* A textual representation of the number of items in the shopping cart.
* @param $total
* The unformatted total of all the products in the shopping cart.
* @param $summary_links
* An array of links used in the cart summary.
* @ingroup themeable
*/
function theme_uc_cart_block_content($help_text, $items, $item_count, $item_text, $total, $summary_links) {
$output = '';
// Add the help text if enabled.
if ($help_text) {
$output .= ''. $help_text .'';
}
// Add a wrapper div for use when collapsing the block.
$output .= '
'. $item['qty'] .' | ' .''. $item['title'] .' | ' .''. uc_price($item['price'], $context) .' |
'. $item['desc'] .' |
'. t('There are no products in your shopping cart.') .'
'; } return $output; } /** * Theme the summary table at the bottom of the default shopping cart block. * * @param $item_count * The number of items in the shopping cart. * @param $item_text * A textual representation of the number of items in the shopping cart. * @param $total * The unformatted total of all the products in the shopping cart. * @param $summary_links * An array of links used in the summary. * @ingroup themeable */ function theme_uc_cart_block_summary($item_count, $item_text, $total, $summary_links) { $context = array( 'revision' => 'themed-original', 'type' => 'amount', ); // Build the basic table with the number of items in the cart and total. $output = ''. $item_text .' | ' .''. uc_price($total, $context) .' |
' . theme('links', $summary_links) .' |
'. t('There are no products in your shopping cart.') .'
'; } /** * 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. * * @ingroup forms * @see * uc_cart_view_form_submit() * theme_uc_cart_view_form() * theme_uc_cart_view_price() * uc_cart_view_table() */ function uc_cart_view_form($form_state, $items = NULL) { $form['items'] = array( '#type' => 'tapir_table', '#tree' => TRUE, ); $context = array( 'revision' => 'themed-original', 'type' => 'amount', ); $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'); $description = $display_item['title']['#value'] . $display_item['description']['#value']; $form['items'][$i]['desc']['#value'] = $description; $form['items'][$i]['title']['#type'] = 'value'; $form['items'][$i]['description']['#type'] = 'value'; if (empty($display_item['qty'])) { $form['items'][$i]['qty'] = array( '#value' => '', ); } $form['items'][$i]['total'] = array( '#value' => uc_price($display_item['#total'], $context), '#theme' => 'uc_cart_view_price', ); $i++; } } $form['items'] = tapir_get_table('uc_cart_view_table', $form['items']); // If the continue shopping element is enabled... if (($cs_type = variable_get('uc_continue_shopping_type', 'link')) !== 'none') { // Setup the text used for the element. $cs_text = variable_get('uc_continue_shopping_text', '') ? variable_get('uc_continue_shopping_text', '') : t('Continue shopping'); // Add the element to the form based on the element type. if (variable_get('uc_continue_shopping_type', 'link') == 'link') { $form['continue_shopping'] = array( '#value' => l($cs_text, uc_cart_continue_shopping_url()), ); } elseif (variable_get('uc_continue_shopping_type', 'link') == 'button') { $form['continue_shopping'] = array( '#type' => 'submit', '#value' => $cs_text, '#submit' => array('uc_cart_view_form_submit'), ); $form['continue_shopping_text'] = array( '#type' => 'hidden', '#value' => $cs_text, ); } } // Add the control buttons for updating and proceeding to checkout. $form['update'] = array( '#type' => 'submit', '#value' => t('Update cart'), '#submit' => array('uc_cart_view_form_submit'), ); if (variable_get('uc_checkout_enabled', TRUE)) { $form['checkout'] = array( '#type' => 'submit', '#value' => t('Checkout'), '#submit' => array('uc_cart_view_form_submit'), ); } return $form; } /** * @see uc_cart_view_form() */ function uc_cart_view_form_submit($form, &$form_state) { // Remove the cart order variable if the customer came here during checkout. if (isset($_SESSION['cart_order'])) { unset($_SESSION['cart_order']); } // Update the items in the shopping cart based on the form values. uc_cart_update_item_object((object)$form_state['values']); // Specify the appropriate redirect based on the button used to submit. switch ($form_state['values']['op']) { // Continue shopping button. case $form_state['values']['continue_shopping_text']: $form_state['redirect'] = uc_cart_continue_shopping_url(); break; // Update cart button. case t('Update cart'): // No redirect. Just display a message and preserve the last URL. drupal_set_message(t('Your cart has been updated.')); break; // Checkout button. case t('Checkout'): $form_state['redirect'] = variable_get('uc_checkout_enabled', TRUE) ? 'cart/checkout' : 'cart'; break; } } /** * @ingroup themeable * @see uc_cart_view_form() */ function theme_uc_cart_view_form($form) { drupal_add_css(drupal_get_path('module', 'uc_cart') .'/uc_cart.css'); $output = '