Skip navigation
Help

theme_uc_cart_block_summary

6 uc_cart.module theme_uc_cart_block_summary($item_count, $item_text, $total, $summary_links)
7 uc_cart.theme.inc theme_uc_cart_block_summary($variables)

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.

Related topics

1 theme call to theme_uc_cart_block_summary()

File

ubercart/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;
}