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
Amount with currency: combination of a NumberType
input and a ChoiceType
input (for currency selection).
PrestaShopBundle\Form\Admin\Type
Option | Type | Default value | Description |
---|---|---|---|
label | boolean |
false |
|
amount_constraints | string |
[] |
|
inherit_data | boolean |
true |
|
currencies | array |
[] |
$builder
->add('amount_currency', AmountCurrencyType::class, [
'amount_constraints' => [
new NotNull(),
new GreaterThan([
'value' => 0,
'message' => $this->translator->trans(
'Invalid value: the payment must be a positive amount.', [], 'Admin.Notifications.Error'
),
]),
],
'currencies' => $this->currencySymbolByIdChoiceProvider->getChoices([
'id_shop' => $this->contextShopId,
]),
])