You are here

function commerce_checkout_form_commerce_checkout_add_complete_rule_form_alter in Commerce Core 7

Implements hook_form_FORM_ID_alter().

The Checkout module instantiates the Rules Admin rule configuration add form at a particular path in the Commerce IA. It uses its own form ID to do so and alters the form here to select the necessary Rules event.

See also

rules_admin_add_reaction_rule()

File

modules/checkout/commerce_checkout.module, line 314
Enable checkout as a multi-step form with customizable pages and a simple checkout pane API.

Code

function commerce_checkout_form_commerce_checkout_add_complete_rule_form_alter(&$form, &$form_state) {
  unset($form['settings']['help']);
  $form['settings']['event']['#type'] = 'value';
  $form['settings']['event']['#value'] = 'commerce_checkout_complete';
  $form['submit']['#suffix'] = l(t('Cancel'), 'admin/commerce/config/checkout/rules');
}