You are here

function hook_commerce_coupon_add_coupon_ajax_alter in Commerce Coupon 7.2

Alter the commands, form and formstate at the point where the coupon module is about return from its checkout pane ajax handler.

Parameters

array $commands: Any commands that have been set

array $form: The checkout form

array $form_state: The checkout form state

1 invocation of hook_commerce_coupon_add_coupon_ajax_alter()
commerce_coupon_add_coupon_callback in includes/commerce_coupon.checkout_pane.inc
Ajax callback: coupon add button.

File

./commerce_coupon.api.php, line 156

Code

function hook_commerce_coupon_add_coupon_ajax_alter($commands, &$form, &$form_state) {

  // Set a JS alert when the coupon checkout pane form is rebuilt via ajax.
  $commands[] = ajax_command_alert(t('Thank you for redeeming a coupon'));
}