$icon_class)); } // Add the main title span and text, with or without the arrow based on the // cart block collapsibility settings. if ($collapsible) { $output .= '' . $help_text . ''; } // Add a table of items in the cart or the empty message. $output .= theme('uc_cart_block_items', array('items' => $items, 'collapsed' => $collapsed)); // Add the summary section beneath the items table. $output .= theme('uc_cart_block_summary', array('item_count' => $item_count, 'item_text' => $item_text, 'total' => $total, 'summary_links' => $summary_links)); return $output; } /** * Themes the table listing the items in the shopping cart block. * * @param $variables * An associative array containing: * - items: An associative array of cart item information containing: * - qty: Quantity in cart. * - title: Item title. * - price: Item price. * - desc: Item description. * - collapsed: TRUE or FALSE indicating whether or not the cart block is * collapsed. * * @ingroup themeable */ function theme_uc_cart_block_items($variables) { $items = $variables['items']; $class = $variables['collapsed'] ? 'cart-block-items collapsed' : 'cart-block-items'; // If there are items in the shopping cart... if ($items) { $output = '
'; } else { $output .= ' '; } return $output; } /** * Themes the shopping cart icon. * * @param $variables * An associative array containing: * - 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($variables) { $icon_class = $variables['icon_class']; return l('', 'cart', array('html' => TRUE)); } /** * Themes the shopping cart block content. * * @param $variables * An associative array containing: * - help_text: Text to place in the small help text area beneath the cart * block title or FALSE if disabled. * - items: An associative array of cart item information containing: * - qty: Quantity in cart. * - title: Item title. * - price: Item price. * - desc: Item description. * - item_count: The number of items in the shopping cart. * - item_text: A textual representation of the number of items in the * shopping cart. * - total: The unformatted total of all the products in the shopping cart. * - summary_links: An array of links used in the cart summary. * - collapsed: TRUE or FALSE indicating whether or not the cart block is * collapsed. * * @ingroup themeable */ function theme_uc_cart_block_content($variables) { $help_text = $variables['help_text']; $items = $variables['items']; $item_count = $variables['item_count']; $item_text = $variables['item_text']; $total = $variables['total']; $summary_links = $variables['summary_links']; $collapsed = $variables['collapsed']; $output = ''; // Add the help text if enabled. if ($help_text) { $output .= '' . $item['qty'] . ' | ' . '' . $item['title'] . ' | ' . '' . theme('uc_price', array('price' => $item['price'])) . ' |
' . $item['desc'] . ' |
' . t('There are no products in your shopping cart.') . '
'; } return $output; } /** * Themes the summary table at the bottom of the default shopping cart block. * * @param $variables * An associative array containing: * - item_count: The number of items in the shopping cart. * - item_text: A textual representation of the number of items in the * shopping cart. * - total: The unformatted total of all the products in the shopping cart. * - summary_links: An array of links used in the summary. * * @ingroup themeable */ function theme_uc_cart_block_summary($variables) { $item_count = $variables['item_count']; $item_text = $variables['item_text']; $total = $variables['total']; $summary_links = $variables['summary_links']; // Build the basic table with the number of items in the cart and total. $output = '' . $item_text . ' | ' . '' . theme('uc_price', array('price' => $total)) . ' |
' . theme('links', array('links' => $summary_links)) . ' |
' . t('There are no products in your shopping cart.') . '
'; } /** * Themes the sale completion page. * * @param $variables * An associative array containing: * - message: Message containing order number info, account info, and link to * continue shopping. * * @ingroup themeable */ function theme_uc_cart_complete_sale($variables) { return $variables['message']; }