function uc_restrict_qty_settings_validate in Ubercart Restrict Qty 6
Same name and namespace in other branches
- 6.2 uc_restrict_qty.module \uc_restrict_qty_settings_validate()
- 7 uc_restrict_qty.module \uc_restrict_qty_settings_validate()
1 string reference to 'uc_restrict_qty_settings_validate'
- uc_restrict_qty_form_alter in ./
uc_restrict_qty.module - Implementation of hook_form_alter().
File
- ./
uc_restrict_qty.module, line 51 - Restrict the quantity on specified products so that only one may be purchased at a time.
Code
function uc_restrict_qty_settings_validate($form, &$form_state) {
if (!is_numeric($form_state['values']['uc_restrict_qty_global']) || $form_state['values']['uc_restrict_qty_global'] < 0) {
form_set_error('uc_restrict_qty_global', t('You must enter 0 or a positive number value.'));
}
}