function uc_product_kit_buy_it_now_form_validate in Ubercart 7.3
Same name and namespace in other branches
- 8.4 uc_product_kit/uc_product_kit.module \uc_product_kit_buy_it_now_form_validate()
- 6.2 uc_product_kit/uc_product_kit.module \uc_product_kit_buy_it_now_form_validate()
Redirects to the product kit page so attributes may be selected.
See also
uc_product_kit_buy_it_now_form()
File
- uc_product_kit/
uc_product_kit.module, line 870 - The product kit module for Ubercart.
Code
function uc_product_kit_buy_it_now_form_validate($form, &$form_state) {
if (module_exists('uc_attribute')) {
$node = node_load($form_state['values']['nid']);
if (is_array($node->products)) {
foreach ($node->products as $nid => $product) {
$attributes = uc_product_get_attributes($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']);
}
}
}
}
}