function uc_ups_product_alter_validate in Ubercart 6.2
Same name and namespace in other branches
- 8.4 shipping/uc_ups/uc_ups.module \uc_ups_product_alter_validate()
- 5 shipping/uc_ups/uc_ups.module \uc_ups_product_alter_validate()
- 7.3 shipping/uc_ups/uc_ups.module \uc_ups_product_alter_validate()
Validation handler for UPS product fields.
See also
1 string reference to 'uc_ups_product_alter_validate'
- uc_ups_form_alter in shipping/
uc_ups/ uc_ups.module - Implements hook_form_alter().
File
- shipping/
uc_ups/ uc_ups.module, line 144 - Shipping quote module that interfaces with www.ups.com to get rates for small package shipments.
Code
function uc_ups_product_alter_validate($form, &$form_state) {
$enabled = variable_get('uc_quote_enabled', array());
if ($form_state['values']['shippable'] && ($form_state['values']['shipping_type'] == 'small_package' || empty($form_state['values']['shipping_type']) && variable_get('uc_store_shipping_type', 'small_package') == 'small_package')) {
if ($form_state['values']['ups']['pkg_type'] == '02' && (empty($form_state['values']['dim_length']) || empty($form_state['values']['dim_width']) || empty($form_state['values']['dim_height']))) {
form_set_error('base][dimensions', t('Dimensions are required for custom packaging.'));
}
}
}