You are here

public function FacebookCheckout::buildPaneForm in Facebook Pixel 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 CheckoutPaneInterface::buildPaneForm

File

modules/facebook_pixel_commerce/src/Plugin/Commerce/CheckoutPane/FacebookCheckout.php, line 85

Class

FacebookCheckout
Provides the completion message pane.

Namespace

Drupal\facebook_pixel_commerce\Plugin\Commerce\CheckoutPane

Code

public function buildPaneForm(array $pane_form, FormStateInterface $form_state, array &$complete_form) {

  // Only fire the FB event on page load.
  if (!$form_state
    ->getTriggeringElement()) {
    $data = $this->facebookComment
      ->getOrderData($this->order);
    $this->facebookEvent
      ->addEvent('InitiateCheckout', $data);
  }
  return [];
}