public function CartLinksSettingsForm::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 ConfigFormBase::submitForm
File
- uc_cart_links/
src/ Form/ CartLinksSettingsForm.php, line 147
Class
- CartLinksSettingsForm
- Configure general shopping cart settings for this site.
Namespace
Drupal\uc_cart_links\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$cart_links_config = $this
->config('uc_cart_links.settings');
$cart_links_config
->setData([
'add_show' => (bool) $form_state
->getValue('uc_cart_links_add_show'),
'track' => (bool) $form_state
->getValue('uc_cart_links_track'),
'empty' => (bool) $form_state
->getValue('uc_cart_links_empty'),
'messages' => (string) $form_state
->getValue('uc_cart_links_messages'),
'restrictions' => (string) $form_state
->getValue('uc_cart_links_restrictions'),
'invalid_page' => (string) $form_state
->getValue('uc_cart_links_invalid_page'),
])
->save();
parent::submitForm($form, $form_state);
}