You are here

function uc_coupon_workflow_form_user_register_form_alter in Ubercart Discount Coupons 7.3

Same name and namespace in other branches
  1. 7.2 uc_coupon_workflow/uc_coupon_workflow.module \uc_coupon_workflow_form_user_register_form_alter()

Implements hook_form_user_register_form_alter().

Gives administrators the option of preventing any coupon workflow rules from being executed when a new user is created.

File

uc_coupon_workflow/uc_coupon_workflow.module, line 52
Discount coupon workflow.

Code

function uc_coupon_workflow_form_user_register_form_alter(&$form, &$form_state) {
  $element = uc_coupon_workflow_suspend_element('user_insert');
  if (isset($element)) {

    // Decide which part of the form to modify.
    if ($form['account']) {
      $use_form =& $form['account'];
    }
    else {
      $use_form =& $form;
    }
    $use_form['uc_coupon_workflow'] = $element;
  }
}