Price ​
The price input type renders VInputPrice, a currency-aware numeric input for entering prices. It supports multiple currency rows, an optional VAT rate selector, an optional discount percentage field, and displays a formatted total when VAT or discount is active.
IMPORTANT
This component requires the SystemPricing module. Currencies are loaded via the CurrencyProviderInterface contract.
Hydrate ​
Class: PriceHydrateConfig type: priceOutput type: input-price → VInputPrice
The hydrate:
- Defaults
nametopricesandlabelto"Prices" - Sets
priceInputNamefromPrice::$priceSavingKey(typicallyprice_value) - Builds the
defaultarray fromPrice::defaultAttributes()with the first available currency - Loads
items(currencies) viaCurrencyProviderInterface::getCurrenciesForSelect() - When
hasVatRate: true, loadsvatRatesfromVatRateRepository - Sets
clearable: false
Usage ​
Basic price field ​
php
[
'type' => 'price',
'name' => 'prices',
'label' => 'Price',
]With VAT rate selector ​
php
[
'type' => 'price',
'name' => 'prices',
'hasVatRate' => true,
]With discount ​
php
[
'type' => 'price',
'name' => 'prices',
'hasDiscount' => true,
'hasVatRate' => true,
]Schema Defaults ​
| Key | Default | Description |
|---|---|---|
name | 'prices' | Form field name |
col | {cols:6, sm:5, md:4} | Default column width |
priceInputName | Price::$priceSavingKey | Key within each price row |
clearable | false | Cannot be cleared |
showVatRate | true | Show the VAT rate selector (when vatRates are present) |
hasDiscount | false | Show a discount percentage field |
numberMultiplier | 100 | Internal multiplier for integer storage |
See Also ​
- Payment Service — Full payment method selector
- Hydrates reference — Resolution table and schema contract