You are here

function theme_uc_cart_block_summary in Ubercart 7.3

Same name and namespace in other branches
  1. 6.2 uc_cart/uc_cart.module \theme_uc_cart_block_summary()

Themes the summary table at the bottom of the default shopping cart block.

Parameters

$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.
1 theme call to theme_uc_cart_block_summary()
theme_uc_cart_block_content in uc_cart/uc_cart.theme.inc
Themes the shopping cart block content.

File

uc_cart/uc_cart.theme.inc, line 184
Theme functions for the uc_cart module.

Code

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 = '<table class="cart-block-summary"><tbody><tr>' . '<td class="cart-block-summary-items">' . $item_text . '</td>' . '<td class="cart-block-summary-total"><label>' . t('Total:') . '</label> ' . theme('uc_price', array(
    'price' => $total,
  )) . '</td></tr>';

  // If there are products in the cart...
  if ($item_count > 0) {

    // Add a view cart link.
    $output .= '<tr class="cart-block-summary-links"><td colspan="2">' . theme('links', array(
      'links' => $summary_links,
    )) . '</td></tr>';
  }
  $output .= '</tbody></table>';
  return $output;
}