You are here

public function CommerceCurrencyResolverForm::submitForm in Commerce Currency Resolver 8

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Overrides ConfigFormBase::submitForm

File

src/Form/CommerceCurrencyResolverForm.php, line 169

Class

CommerceCurrencyResolverForm
Class CommerceCurrencyResolverForm.

Namespace

Drupal\commerce_currency_resolver\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('commerce_currency_resolver.settings');

  // Set values.
  $config
    ->set('currency_mapping', $form_state
    ->getValue('currency_mapping'))
    ->set('currency_geo', $form_state
    ->getValue('currency_geo'))
    ->set('currency_source', $form_state
    ->getValue('currency_source'))
    ->set('currency_default', $form_state
    ->getValue('currency_default'))
    ->set('currency_exchange_rates', $form_state
    ->getValue('currency_exchange_rates'))
    ->save();
  parent::submitForm($form, $form_state);
}