You are here

public function CommerceCartRedirectionConfigForm::submitForm in Commerce Cart Redirection 3.0.x

Same name and namespace in other branches
  1. 8.2 src/Form/CommerceCartRedirectionConfigForm.php \Drupal\commerce_cart_redirection\Form\CommerceCartRedirectionConfigForm::submitForm()

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/CommerceCartRedirectionConfigForm.php, line 169

Class

CommerceCartRedirectionConfigForm
Class CommerceCartRedirectionConfigForm.

Namespace

Drupal\commerce_cart_redirection\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $values = $form_state
    ->getValues();
  $this
    ->config('commerce_cart_redirection.settings')
    ->set('product_bundles', $values['product_bundles'])
    ->set('negate_product_bundles', $values['negate_product_bundles'])
    ->set('redirection_route_path', $values['redirection_route_path'])
    ->set('redirection_route_path_other', $values['redirection_route_path_other'])
    ->set('add_to_cart_replacement_text', $values['add_to_cart_replacement_text'])
    ->save();
}