public function Price::buildOptionsForm in Ubercart 8.4
Default options form that provides the label widget that all fields should have.
Overrides NumericField::buildOptionsForm
File
- uc_store/
src/ Plugin/ views/ field/ Price.php, line 32
Class
- Price
- Field handler to provide formatted prices.
Namespace
Drupal\uc_store\Plugin\views\fieldCode
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['format'] = [
'#title' => $this
->t('Format'),
'#type' => 'radios',
'#options' => [
'uc_price' => $this
->t('Ubercart price'),
'numeric' => $this
->t('Numeric'),
],
'#default_value' => $this->options['format'],
'#weight' => -1,
];
foreach ([
'separator',
'format_plural',
'prefix',
'suffix',
] as $field) {
$form[$field]['#states']['visible']['input[name="options[format]"]']['value'] = 'numeric';
}
}