You are here

public function CompletionMessage::buildPaneForm in Commerce Core 8.2

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 CheckoutPaneInterface::buildPaneForm

File

modules/checkout/src/Plugin/Commerce/CheckoutPane/CompletionMessage.php, line 104

Class

CompletionMessage
Provides the completion message pane.

Namespace

Drupal\commerce_checkout\Plugin\Commerce\CheckoutPane

Code

public function buildPaneForm(array $pane_form, FormStateInterface $form_state, array &$complete_form) {
  $message = $this->token
    ->replace($this->configuration['message']['value'], [
    'commerce_order' => $this->order,
  ]);
  $pane_form['message'] = [
    '#theme' => 'commerce_checkout_completion_message',
    '#order_entity' => $this->order,
    '#message' => [
      '#type' => 'processed_text',
      '#text' => $message,
      '#format' => $this->configuration['message']['format'],
    ],
  ];
  return $pane_form;
}