You are here

function obsolete_uc_fulfillment_shipment_print in Ubercart 8.4

Displays the packing slip and shipping labels for printing.

File

shipping/uc_fulfillment/uc_fulfillment.module, line 186
Organizes ordered products into packages and sets them up for shipment.

Code

function obsolete_uc_fulfillment_shipment_print(array $variables) {
  $order = $variables['order'];
  $shipment = $variables['shipment'];
  $labels = $variables['labels'];
  $output = theme('uc_packing_slip', [
    '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) = [
          672,
          392,
        ];
        $output .= '<br class="page-break" />' . "\n";
        $output .= theme('image', [
          'uri' => $package->label_image->uri,
          'attributes' => [
            'width' => $width,
            'height' => $height,
          ],
          'getsize' => FALSE,
        ]) . "\n";
      }
    }
  }
  return $output;
}