You are here

public function StockTransactions1::submitForm in Commerce Stock 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 FormInterface::submitForm

File

modules/ui/src/Form/StockTransactions1.php, line 56

Class

StockTransactions1
The first part of a two part create stock transaction form.

Namespace

Drupal\commerce_stock_ui\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {

  // Get the selected product.
  $product_variation_id = $form_state
    ->getValue('product_variation');

  // Send to the second part form.
  $form_state
    ->setRedirect('commerce_stock_ui.stock_transactions2', [
    'commerce_product_v_id' => $product_variation_id,
  ]);
}