You are here

function theme_uc_shipping_shipment_print in Ubercart 7.3

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

Displays the packing slip and shipping labels for printing.

1 theme call to theme_uc_shipping_shipment_print()
uc_shipping_shipment_print in shipping/uc_shipping/uc_shipping.admin.inc
Shows a printer-friendly version of a shipment.

File

shipping/uc_shipping/uc_shipping.admin.inc, line 1093
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;
}