You are here

function uc_shipping_new_shipment_submit in Ubercart 5

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

Submit handler for uc_shipping_new_shipment().

Send package information to the chosen method.

See also

uc_shipping_make_shipment

File

shipping/uc_shipping/uc_shipping.module, line 729
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 uc_shipping_new_shipment_submit($form_id, $form_values) {
  $packages = array();
  foreach ($form_values as $shipping_type) {
    if (is_array($shipping_type['packages'])) {
      foreach ($shipping_type['packages'] as $id => $input) {
        if ($input['checked']) {
          $packages[] = $id;
        }
      }
    }
  }
  return 'admin/store/orders/' . $form_values['order_id'] . '/ship/' . $form_values['method'] . '/' . implode('/', $packages);
}