You are here

function uc_quote_method_settings_validate in Ubercart 5

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

Validation handler for uc_quote_method_settings().

Must enable at least one shipping method.

File

shipping/uc_quote/uc_quote.module, line 837
The controller module for fulfillment modules that process physical goods.

Code

function uc_quote_method_settings_validate($form_id, $form_values) {
  $none_enabled = true;
  if (is_array($form_values['methods'])) {
    foreach ($form_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.'));
  }
}