You are here

function commerce_order_ui_form_commerce_order_ui_order_form_alter in Commerce Core 7

Implements hook_form_FORM_ID_alter().

The Order UI module instantiates the Order add/edit form at particular paths in the Commerce IA. It uses its own form ID to do so and alters the form here to add in appropriate redirection.

See also

commerce_order_ui_order_form()

File

modules/order/commerce_order_ui.module, line 274

Code

function commerce_order_ui_form_commerce_order_ui_order_form_alter(&$form, &$form_state) {

  // Add a submit handler to the save button to add a redirect.
  $form['actions']['submit']['#submit'][] = 'commerce_order_ui_order_form_submit';
  $form['actions']['submit']['#suffix'] = l(t('Cancel'), 'admin/commerce/orders');
}