You are here

function uc_weightquote_admin_method_edit_form_validate in Ubercart 5

Same name and namespace in other branches
  1. 6.2 shipping/uc_weightquote/uc_weightquote.admin.inc \uc_weightquote_admin_method_edit_form_validate()

File

shipping/uc_weightquote/uc_weightquote.module, line 272
Shipping quote module that defines a shipping rate for each product based on weight.

Code

function uc_weightquote_admin_method_edit_form_validate($form_id, $form_values) {
  if ($form_values['op'] == t('Submit')) {
    if (!empty($form_values['base_rate']) && !is_numeric($form_values['base_rate'])) {
      form_set_error('base_rate', t('The base rate must be a numeric amount.'));
    }
    if (!empty($form_values['unit_rate']) && !is_numeric($form_values['unit_rate'])) {
      form_set_error('unit_rate', t('The adjustment per unit must be a numeric amount.'));
    }
  }
}