Quantity field that displays the initial quantity (not editable) and allows editing with delta quantity instead (ex: +5, -8). The input data of this form type is the initial (as a plain integer) however, its output on submit is the delta quantity.
Option | Type | Default value | Description |
---|
$builder->add('delta_quantity', DeltaQuantityType::class, [
'required' => false,
'label' => $this->trans('Edit quantity', 'Admin.Catalog.Feature'),
'disabling_switch' => true,
'disabling_switch_event' => 'combinationSwitchDeltaQuantity',
'disabled_value' => function (?array $data) {
return empty($data['quantity']) && empty($data['delta']);
},
])