You are here

public function UnitPriceWidget::settingsSummary in Commerce Core 8.2

Returns a short summary for the current widget settings.

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

Return value

array A short summary of the widget settings.

Overrides WidgetBase::settingsSummary

File

modules/order/src/Plugin/Field/FieldWidget/UnitPriceWidget.php, line 102

Class

UnitPriceWidget
Plugin implementation of the 'commerce_unit_price' widget.

Namespace

Drupal\commerce_order\Plugin\Field\FieldWidget

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  if ($this
    ->getSetting('require_confirmation') == 1) {
    $summary[] = $this
      ->t('Require confirmation before overriding the unit price');
  }
  else {
    $summary[] = $this
      ->t('Do not require confirmation before overriding the unit price');
  }
  return $summary;
}