You are here

public function ContactSubscription::buildPaneSummary in Mailchimp E-Commerce 8

Builds a summary of the pane values.

Important: The review pane shows summaries for both visible and non-visible panes. To skip showing a summary for a non-visible pane, check isVisible() and return an empty array.

Return value

array A render array containing the summary of the pane values.

Overrides CheckoutPaneBase::buildPaneSummary

File

modules/mailchimp_ecommerce_commerce/src/Plugin/Commerce/CheckoutPane/ContactSubscription.php, line 129

Class

ContactSubscription
Provides the subscription information pane.

Namespace

Drupal\mailchimp_ecommerce_commerce\Plugin\Commerce\CheckoutPane

Code

public function buildPaneSummary() {
  $pane_form = [];
  if ($this->configuration['review'] == 1) {

    // @TODO $form_state isn't available here. How can the value selected be
    // retrieved?
    $value_label = $this->configuration['review_label_on'];
    $pane_form['subscription'] = [
      '#type' => 'markup',
      '#markup' => $this->configuration['review_label'] . ' ' . $value_label,
    ];
  }
  return $pane_form;
}