Warning: You are browsing the documentation for PrestaShop 8, which is outdated.
You might want to read an updated version of this page for the current version, PrestaShop 9. Read the updated version of this page
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']);
},
])