function uc_shipping_package_edit_submit in Ubercart 7.3
Same name and namespace in other branches
- 5 shipping/uc_shipping/uc_shipping.module \uc_shipping_package_edit_submit()
- 6.2 shipping/uc_shipping/uc_shipping.admin.inc \uc_shipping_package_edit_submit()
Submit handler for uc_shipping_package_edit().
See also
File
- shipping/
uc_shipping/ uc_shipping.admin.inc, line 402 - Shipping administration menu items.
Code
function uc_shipping_package_edit_submit($form, &$form_state) {
$package = uc_shipping_package_load($form_state['values']['package_id']);
foreach ($form_state['values']['products'] as $id => $product) {
if ($product['checked']) {
$package->products[$id] = (object) $product;
}
else {
unset($package->products[$id]);
}
}
$package->shipping_type = $form_state['values']['shipping_type'];
uc_shipping_package_save($package);
$form_state['redirect'] = 'admin/store/orders/' . $package->order_id . '/packages';
}