You are here

function theme_uc_cart_checkout_review in Ubercart 7.3

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. 6.2 uc_cart/uc_cart.pages.inc \theme_uc_cart_checkout_review()

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.

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