You are here

public function StockReportForm::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_stock/src/Form/StockReportForm.php, line 45

Class

StockReportForm
Displays a stock report for products with stock tracking enabled.

Namespace

Drupal\uc_stock\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  if ($form_state
    ->getValue('threshold')) {
    $form_state
      ->setRedirect('uc_stock.threshold');
  }
  else {
    $form_state
      ->setRedirect('uc_stock.settings');
  }
}