uc_catalog_buy_it_now_form_validate

  1. drupal
    1. 6 uc_product.module function
    2. 7 uc_product.module function
Drupal 7 uc_catalog_buy_it_now_form_validate($form, &$form_state)

Redirects to the product page if attributes need to be selected.

See also

uc_catalog_buy_it_now_form()

uc_catalog_buy_it_now_form_submit()

File

sites/all/modules/ubercart/uc_product/uc_product.module, line 1146
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']);
    }
  }
}