You are here

function commerce_product_reference_field_settings_form in Commerce Core 7

Implements hook_field_settings_form().

File

modules/product_reference/commerce_product_reference.module, line 575
Defines a field type for referencing products from other entities.

Code

function commerce_product_reference_field_settings_form($field, $instance, $has_data) {
  $settings = $field['settings'];
  $form = array();
  if ($field['type'] == 'commerce_product_reference') {
    $options = array();
    $form['options_list_limit'] = array(
      '#type' => 'textfield',
      '#title' => t('Options list limit'),
      '#description' => t('Limits the number of products available in field widgets with options lists; leave blank for no limit.'),
      '#default_value' => !empty($settings['options_list_limit']) ? $settings['options_list_limit'] : '',
      '#element_validate' => array(
        'commerce_options_list_limit_validate',
      ),
    );
  }
  return $form;
}