function uc_quote_method_settings_validate in Ubercart 7.3
Same name and namespace in other branches
- 5 shipping/uc_quote/uc_quote.module \uc_quote_method_settings_validate()
- 6.2 shipping/uc_quote/uc_quote.admin.inc \uc_quote_method_settings_validate()
Form validation for uc_quote_method_settings().
Requires at least one enabled shipping method.
See also
uc_quote_method_settings_submit()
File
- shipping/
uc_quote/ uc_quote.admin.inc, line 253 - Shipping quotes administration menu items.
Code
function uc_quote_method_settings_validate($form, &$form_state) {
$none_enabled = TRUE;
if (is_array($form_state['values']['methods'])) {
foreach ($form_state['values']['methods'] as $method) {
if ($method['uc_quote_enabled']) {
$none_enabled = FALSE;
}
}
}
if ($none_enabled) {
form_set_error('uc_quote_enabled', t('At least one shipping quote method must be enabled.'));
}
}