You are here

function commerce_addressbook_form_alter in Commerce Addressbook 7.3

Same name and namespace in other branches
  1. 7.2 commerce_addressbook.module \commerce_addressbook_form_alter()

Implements hook_form_alter().

File

./commerce_addressbook.module, line 501
Defines addressbook functionality for customer profiles, allowing them to be reused and managed on a per-user basis.

Code

function commerce_addressbook_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'commerce_addressbook_customer_profile_form') {

    // Make sure the submit handlers run.
    rsort($form['actions']['submit']['#submit']);
    foreach ($form['actions']['submit']['#submit'] as $callback) {
      array_unshift($form['#submit'], $callback);
    }
    unset($form['actions']['submit']['#submit']);

    // Hide the "Additional settings" vertical tabs.
    $form['additional_settings']['#access'] = FALSE;
  }
}