You are here

function vat_number_field_widget_settings_form in VAT Number 7

Implements hook_field_widget_settings_form().

File

./vat_number.module, line 57
Define a VAT Number field for use on Drupal Commerce Customer Profiles.

Code

function vat_number_field_widget_settings_form($field, $instance) {
  $widget = $instance['widget'];
  $settings = $widget['settings'];
  $form = array();
  if ($widget['type'] == 'vat_number_widget') {
    $form['skip_validation_on_service_failure'] = array(
      '#type' => 'checkbox',
      '#title' => t('Soft validation'),
      '#description' => t('Skip validation against EU service if it is having troubles.'),
      '#default_value' => $settings['skip_validation_on_service_failure'],
    );
  }
  return $form;
}