You are here

public function CheckoutForm::submitForm in Ubercart 8.4

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 FormInterface::submitForm

File

uc_cart/src/Form/CheckoutForm.php, line 177

Class

CheckoutForm
The checkout form built up from the enabled checkout panes.

Namespace

Drupal\uc_cart\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  if ($form_state
    ->get('checkout_valid') === FALSE) {
    $form_state
      ->setRedirect('uc_cart.checkout');
  }
  else {
    $form_state
      ->setRedirect('uc_cart.checkout_review');
    $this->session
      ->set('uc_checkout_review_' . $form_state
      ->get('order')
      ->id(), TRUE);
  }
  $form_state
    ->set('checkout_valid', NULL);
}