public function EmailRegistrationCompletionRegistration::buildPaneForm in Email Registration 8
Builds the pane form.
Parameters
array $pane_form: The pane form, containing the following basic properties:
- #parents: Identifies the position of the pane form in the overall parent form, and identifies the location where the field values are placed within $form_state->getValues().
\Drupal\Core\Form\FormStateInterface $form_state: The form state of the parent form.
array $complete_form: The complete form structure.
Overrides CompletionRegister::buildPaneForm
File
- src/
Plugin/ Commerce/ CheckoutPane/ EmailRegistrationCompletionRegistration.php, line 23
Class
- EmailRegistrationCompletionRegistration
- Provides the registration pane without username.
Namespace
Drupal\email_registration\Plugin\Commerce\CheckoutPaneCode
public function buildPaneForm(array $pane_form, FormStateInterface $form_state, array &$complete_form) {
$pane_form = parent::buildPaneForm($pane_form, $form_state, $complete_form);
// Set the name as per email_registration_form_user_register_form_alter().
$pane_form['name'] = [
'#type' => 'hidden',
'#value' => 'email_registration_' . user_password(),
];
// Try and help password managers.
// https://www.chromium.org/developers/design-documents/form-styles-that-chromium-understands
$pane_form['email'] = [
'#type' => 'textfield',
'#value' => $this->order
->getEmail(),
'#attributes' => [
'autocomplete' => 'username',
],
'#wrapper_attributes' => [
'style' => 'display: none;',
],
];
return $pane_form;
}