function uc_catalog_buy_it_now_form_validate in Ubercart 7.3
Same name and namespace in other branches
- 6.2 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()
File
- uc_product/
uc_product.module, line 1174 - 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']);
}
}
}