function uc_catalog_buy_it_now_form_validate in Ubercart 6.2
Same name and namespace in other branches
- 7.3 uc_product/uc_product.module \uc_catalog_buy_it_now_form_validate()
Redirects to the product page if attributes need to be selected.
See also
uc_catalog_buy_it_now_form_submit()
1 string reference to 'uc_catalog_buy_it_now_form_validate'
- uc_catalog_buy_it_now_form in uc_product/
uc_product.module - Form builder for uc_catalog_buy_it_now_form().
File
- uc_product/
uc_product.module, line 1402 - The product module for Ubercart.
Code
function uc_catalog_buy_it_now_form_validate($form, &$form_state) {
if (module_exists('uc_attribute')) {
$attributes = uc_product_get_attributes($form_state['values']['nid']);
if (!empty($attributes)) {
drupal_set_message(t('This product has options that need to be selected before purchase. Please select them in the form below.'), 'error');
drupal_goto('node/' . $form_state['values']['nid']);
}
}
}