You are here

function theme_uc_cart_checkout_review in Ubercart 6.2

Same name and namespace in other branches
  1. 8.4 uc_cart/uc_cart.theme.inc \theme_uc_cart_checkout_review()
  2. 5 uc_cart/uc_cart.module \theme_uc_cart_checkout_review()
  3. 7.3 uc_cart/uc_cart.pages.inc \theme_uc_cart_checkout_review()

Themes the checkout review order page.

Parameters

$panes: An associative array for each checkout pane that has information to add to the review page. The key is the pane's title and the value is either the data returned for that pane or an array of returned data.

$form: The HTML version of the form that by default includes the 'Back' and 'Submit order' buttons at the bottom of the review page.

Return value

A string of HTML for the page contents.

1 theme call to theme_uc_cart_checkout_review()
uc_cart_checkout_review in uc_cart/uc_cart.pages.inc
Allows a customer to review their order before finally submitting it.

File

uc_cart/uc_cart.pages.inc, line 419
Cart menu items.

Code

function theme_uc_cart_checkout_review($panes, $form) {
  drupal_add_css(drupal_get_path('module', 'uc_cart') . '/uc_cart.css');
  $output = check_markup(variable_get('uc_checkout_review_instructions', uc_get_message('review_instructions')), variable_get('uc_checkout_review_instructions_format', FILTER_FORMAT_DEFAULT), FALSE) . '<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 valign="top"' . $border . '>';
          $output .= '<td class="title-col">' . $row['title'] . ':</td>';
          $output .= '<td class="data-col">' . $row['data'] . '</td>';
          $output .= '</tr>';
        }
        else {
          $output .= '<tr valign="top"><td colspan="2">' . $row . '</td></tr>';
        }
      }
    }
    else {
      $output .= '<tr valign="top"><td colspan="2">' . $data . '</td></tr>';
    }
  }
  $output .= '<tr class="review-button-row">';
  $output .= '<td colspan="2">' . $form . '</td>';
  $output .= '</tr>';
  $output .= '</table>';
  return $output;
}