Skip navigation
Help

theme_uc_cart_checkout_review

6 uc_cart.pages.inc theme_uc_cart_checkout_review($panes, $form)
7 uc_cart.pages.inc theme_uc_cart_checkout_review($variables)

Themes the checkout review order page.

Parameters

$variables: An associative array containing:

  • form: A render element representing the form, that by default includes the 'Back' and 'Submit order' buttons at the bottom of the review page.
  • panes: An associative array for each checkout pane that has information to add to the review page, keyed by the pane title:

    • <pane title>: The data returned for that pane or an array of returned data.

Return value

A string of HTML for the page contents.

Related topics

File

ubercart/uc_cart/uc_cart.pages.inc, line 463
Cart menu items.

Code

function theme_uc_cart_checkout_review($variables) {
  $panes = $variables['panes'];
  $form = $variables['form'];

  drupal_add_css(drupal_get_path('module', 'uc_cart') . '/uc_cart.css');

  $output = '<div id="review-instructions">' . filter_xss_admin(variable_get('uc_checkout_review_instructions', uc_get_message('review_instructions'))) . '</div>';

  $output .= '<table class="order-review-table">';

  foreach ($panes as $title => $data) {
    $output .= '<tr class="pane-title-row">';
    $output .= '<td colspan="2">' . $title . '</td>';
    $output .= '</tr>';
    if (is_array($data)) {
      foreach ($data as $row) {
        if (is_array($row)) {
          if (isset($row['border'])) {
            $border = ' class="row-border-' . $row['border'] . '"';
          }
          else {
            $border = '';
          }
          $output .= '<tr' . $border . '>';
          $output .= '<td class="title-col">' . $row['title'] . ':</td>';
          $output .= '<td class="data-col">' . $row['data'] . '</td>';
          $output .= '</tr>';
        }
        else {
          $output .= '<tr><td colspan="2">' . $row . '</td></tr>';
        }
      }
    }
    else {
      $output .= '<tr><td colspan="2">' . $data . '</td></tr>';
    }
  }

  $output .= '<tr class="review-button-row">';
  $output .= '<td colspan="2">' . drupal_render($form) . '</td>';
  $output .= '</tr>';

  $output .= '</table>';

  return $output;
}