theme_uc_cart_checkout_review

Function theme_uc_cart_checkout_review() in uc_cart.module:

<?php
  theme_uc_cart_checkout_review
($help, $panes, $form)
?>


Description:

This function themes the page that you see after submitting the checkout form for review. This simply puts everything in a table devoid of useful classes and IDs.

I (Ryan) will happily entertain improved theme functions for this part of Ubercart!

Parameters:
  • $help - A string containing the review order page help message
  • $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 containing the HTML output for the review order page.


Example:

<?php
// Default function from uc_cart.module.
function theme_uc_cart_checkout_review($help, $panes, $form) {
 
drupal_add_css(drupal_get_path('module', 'uc_cart') .'/uc_cart.css');

 
$output = '<div>'. check_markup(variable_get('uc_checkout_review_instructions'uc_get_message('review_instructions')),
                    
variable_get('uc_checkout_review_instructions_format', 3),
                    
FALSE) . '</div><table class="order-review-table">';

  foreach (
$panes as $title => $data) {
   
$output .= '<tr class="pane-title-row"><td colspan="2">'. $title
             
.'</td></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 .'><td class="title-col" '
                   
.'nowrap>'. $row['title'] .':</td><td class="data-col">'
                  
. $row['data'] .'</td></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"><td colspan="2">'. $form
           
.'</td></tr></table>';

  return
$output;
}
?>