You are here

function commerce_customer_form_field_ui_field_edit_form_alter in Commerce Core 7

Implements hook_form_FORM_ID_alter().

File

modules/customer/commerce_customer.module, line 925
Defines the customer profile entity and API functions to manage customers and interact with them.

Code

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

  // Alter the field edit form so it's obvious that customer profile manager
  // widgets do not support multiple values.
  if (empty($form['locked']) && !empty($form['instance']) && $form['instance']['widget']['type']['#value'] == 'commerce_customer_profile_manager') {
    $form['field']['cardinality']['#options'] = array(
      '1' => '1',
    );
    $form['field']['cardinality']['#description'] = t('The customer profile manager widget only supports single value editing and entry via its form.');
  }
}