You are here

function uc_coupon_purchase_coupon_settings_form_submit in Ubercart Discount Coupons 7.3

Submit handler for uc_coupon_settings_form.

1 string reference to 'uc_coupon_purchase_coupon_settings_form_submit'
uc_coupon_purchase_form_uc_coupon_settings_form_alter in uc_coupon_purchase/uc_coupon_purchase.module
Implements hook_form_FORM_ID_alter() for uc_coupon_settings_form.

File

uc_coupon_purchase/uc_coupon_purchase.module, line 557

Code

function uc_coupon_purchase_coupon_settings_form_submit($form, $form_state) {

  // Create the recipient attribute.
  if (!empty($form_state['values']['uc_coupon_purchase_recipient_enabled'])) {
    if (module_exists('uc_attribute')) {
      if (!($attribute = _uc_coupon_purchase_load_recipient_attribute())) {
        $attribute = _uc_coupon_purchase_create_recipient_attribute();
        drupal_set_message(t('The "@name" attribute has been created', array(
          '@name' => $attribute->name,
        )));
      }
    }
  }
}