You are here

public function ShippingByWeight::submitConfigurationForm in Commerce Shipping Weight Tariff 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Commerce/ShippingMethod/ShippingByWeight.php \Drupal\commerce_shipping_weight_tariff\Plugin\Commerce\ShippingMethod\ShippingByWeight::submitConfigurationForm()

Form submission handler.

Parameters

array $form: An associative array containing the structure of the plugin form as built by static::buildConfigurationForm().

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Calling code should pass on a subform state created through \Drupal\Core\Form\SubformState::createForSubform().

Overrides ShippingMethodBase::submitConfigurationForm

File

src/Plugin/Commerce/ShippingMethod/ShippingByWeight.php, line 108

Class

ShippingByWeight
Provides the FlatRatePerItem shipping method.

Namespace

Drupal\commerce_shipping_weight_tariff\Plugin\Commerce\ShippingMethod

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['rate_label'] = $values['rate_label'];
    $this->configuration['base_rate_amount'] = $values['base_rate_amount'];
  }
}