public function ProductVariationTitleWidget::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/
product/ src/ Plugin/ Field/ FieldWidget/ ProductVariationTitleWidget.php, line 64
Class
- ProductVariationTitleWidget
- Plugin implementation of the 'commerce_product_variation_title' widget.
Namespace
Drupal\commerce_product\Plugin\Field\FieldWidgetCode
public function settingsSummary() {
$summary = parent::settingsSummary();
$summary[] = $this
->t('Label: "@text" (@visible)', [
'@text' => $this
->getSetting('label_text'),
'@visible' => $this
->getSetting('label_display') ? $this
->t('visible') : $this
->t('hidden'),
]);
if ($this
->getSetting('hide_single')) {
$summary[] = $this
->t("Hidden if there's only one product variation.");
}
return $summary;
}