You are here

public function Products::productSelectValidate in Ubercart 8.4

Validation handler for self::productSelectForm().

File

uc_order/src/Plugin/Ubercart/OrderPane/Products.php, line 274

Class

Products
Manage the products an order contains.

Namespace

Drupal\uc_order\Plugin\Ubercart\OrderPane

Code

public function productSelectValidate($form, FormStateInterface $form_state) {
  if ($form_state
    ->isValueEmpty([
    'product_controls',
    'nid',
  ])) {
    $form_state
      ->setErrorByName('product_controls][nid', $this
      ->t('Please select a product.'));
  }
}