Skip navigation
Help

theme_uc_shipping_shipment_print

6 uc_shipping.admin.inc theme_uc_shipping_shipment_print($order, $shipment, $labels = TRUE)
7 uc_shipping.admin.inc theme_uc_shipping_shipment_print($variables)

Displays the packing slip and shipping labels for printing.

Related topics

File

ubercart/shipping/uc_shipping/uc_shipping.admin.inc, line 1086
Shipping administration menu items.

Code

function theme_uc_shipping_shipment_print($variables) {
  $order = $variables['order'];
  $shipment = $variables['shipment'];
  $labels = $variables['labels'];

  $output = theme('uc_packing_slip', array('order' => $order, 'shipment' => $shipment));

  if ($labels) {
    foreach ($shipment->packages as $id => $package) {
      if (isset($package->label_image) && 
          file_exists($package->label_image->uri)) {
        // TODO: Find a way to store these magic numbers specifically for UPS.
        list($width, $height) = array(672, 392);
        $output .= '<br class="page-break" />' . "\n";
        $output .= theme('image', array(
          'path' => $package->label_image->uri, 
          'attributes' => array('width' => $width, 'height' => $height), 
          'getsize' => FALSE,
        )) . "\n";
      }
    }
  }

  return $output;
}