You are here

public function PercentageOffTrait::submitConfigurationForm in Commerce Core 8.2

File

modules/promotion/src/Plugin/Commerce/PromotionOffer/PercentageOffTrait.php, line 70

Class

PercentageOffTrait
Provides common configuration for percentage off offers.

Namespace

Drupal\commerce_promotion\Plugin\Commerce\PromotionOffer

Code

public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
  parent::submitConfigurationForm($form, $form_state);
  if (!$form_state
    ->getErrors()) {
    $values = $form_state
      ->getValue($form['#parents']);
    $this->configuration['percentage'] = (string) ($values['percentage'] / 100);
  }
}