You are here

function uc_shipping_new_shipment_submit in Ubercart 7.3

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

Submit handler for uc_shipping_new_shipment().

Sends package information to the chosen method.

See also

uc_shipping_new_shipment()

File

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

Code

function uc_shipping_new_shipment_submit($form, &$form_state) {
  $packages = array();
  foreach ($form_state['values']['shipping_types'] as $shipping_type) {
    if (is_array($shipping_type['packages'])) {
      foreach ($shipping_type['packages'] as $id => $input) {
        if ($input['checked']) {
          $packages[] = $id;
        }
      }
    }
  }
  $form_state['redirect'] = 'admin/store/orders/' . $form_state['values']['order_id'] . '/ship/' . $form_state['values']['method'] . '/' . implode('/', $packages);
}