public function ContactInformation::validatePaneForm in Commerce Core 8.2
Validates the pane form.
Parameters
array $pane_form: The pane form.
\Drupal\Core\Form\FormStateInterface $form_state: The form state of the parent form.
array $complete_form: The complete form structure.
Overrides CheckoutPaneBase::validatePaneForm
File
- modules/
checkout/ src/ Plugin/ Commerce/ CheckoutPane/ ContactInformation.php, line 111
Class
- ContactInformation
- Provides the contact information pane.
Namespace
Drupal\commerce_checkout\Plugin\Commerce\CheckoutPaneCode
public function validatePaneForm(array &$pane_form, FormStateInterface $form_state, array &$complete_form) {
$values = $form_state
->getValue($pane_form['#parents']);
if ($this->configuration['double_entry'] && $values['email'] != $values['email_confirm']) {
$form_state
->setError($pane_form, $this
->t('The specified emails do not match.'));
}
}