You are here

function theme_uc_shipping_new_shipment in Ubercart 5

Same name and namespace in other branches
  1. 6.2 shipping/uc_shipping/uc_shipping.admin.inc \theme_uc_shipping_new_shipment()
  2. 7.3 shipping/uc_shipping/uc_shipping.admin.inc \theme_uc_shipping_new_shipment()

Format and display the new shipment form.

File

shipping/uc_shipping/uc_shipping.module, line 700
Organizes ordered products into packages and sets them up for shipment. Shipping method modules may add functionality to generate shipping labels and tracking numbers.

Code

function theme_uc_shipping_new_shipment($form) {
  $output = '';
  $header = array(
    theme('table_select_header_cell'),
    t('Package'),
    t('Products'),
    t('Weight'),
  );
  foreach (element_children($form) as $shipping_type) {
    $rows = array();
    foreach (element_children($form[$shipping_type]['packages']) as $package_id) {
      $row = array();
      $row[] = drupal_render($form[$shipping_type]['packages'][$package_id]['checked']);
      $row[] = drupal_render($form[$shipping_type]['packages'][$package_id]['package_id']);
      $row[] = drupal_render($form[$shipping_type]['packages'][$package_id]['products']);
      $row[] = drupal_render($form[$shipping_type]['packages'][$package_id]['weight']);
      $rows[] = $row;
    }
    if (count($rows)) {
      $form[$shipping_type]['packages']['table'] = array(
        '#value' => theme('table', $header, $rows),
      );
    }

    //$output .= drupal_render($form[$shipping_type]['methods']);
  }
  $output .= drupal_render($form);
  return $output;
}