You are here

function commerce_payment_ui_form_commerce_payment_order_transaction_add_form_alter in Commerce Core 7

Implements hook_form_FORM_ID_alter().

Adds a Cancel link to the Save button for the payment terminal form that is part of the View used as the order Payment tab.

File

modules/payment/commerce_payment_ui.module, line 174
Default Payment UI for Drupal Commerce.

Code

function commerce_payment_ui_form_commerce_payment_order_transaction_add_form_alter(&$form, &$form_state) {
  if (!empty($form_state['payment_method'])) {
    $form['actions']['submit']['#suffix'] = l(t('Cancel'), 'admin/commerce/orders/' . $form_state['order']->order_id . '/payment');
  }
}