You are here

public function AddToCartFormatter::settingsSummary in Commerce Product Bundle 8

Returns a short summary for the current formatter settings.

If an empty result is returned, a UI can still be provided to display a settings form in case the formatter has configurable settings.

Return value

string[] A short summary of the formatter settings.

Overrides FormatterBase::settingsSummary

File

src/Plugin/Field/FieldFormatter/AddToCartFormatter.php, line 49

Class

AddToCartFormatter
Plugin implementation of the 'commerce_product_bundle_add_to_cart' formatter.

Namespace

Drupal\commerce_product_bundle\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = [];
  if ($this
    ->getSetting('combine')) {
    $summary[] = $this
      ->t('Combine order items containing the same product bundle items.');
  }
  else {
    $summary[] = $this
      ->t('Do not combine order items containing the same product bundle items.');
  }
  return $summary;
}