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

Learn how to update to the latest version.

PriceReductionType

Responsible for creating form for price reduction

Type options

Option Type Default value Description

Code example

$builder->add('reduction', PriceReductionType::class, [
    'constraints' => [
        new Reduction([
            'invalidPercentageValueMessage' => $this->translator->trans(
                'Reduction value "%value%" is invalid. Allowed values from 0 to %max%',
                ['%max%' => ReductionVO::MAX_ALLOWED_PERCENTAGE . '%'],
                'Admin.Notifications.Error'
            ),
            'invalidAmountValueMessage' => $this->translator->trans(
                'Reduction value "%value%" is invalid. Value cannot be negative',
                [],
                'Admin.Notifications.Error'
            ),
        ]),
    ],
])