Types
The types of @poltura/theme-sdk/price.
Ezen az oldalon
import { … } from '@poltura/theme-sdk/price';MeasureUnit
A unit a product's contents or a unit price is measured in.
type MeasureUnit = 'mg' | 'g' | 'kg' | 'ml' | 'cl' | 'l' | 'm3' | 'cm' | 'm' | 'm2' | 'ct'Money
An amount of money in major units (12.99, not 1299).
amountrequirednumberThe amount in major units.
currencyCoderequiredCurrencyCodeThe currency of the amount.
PriceAccess
Whether and how the current visitor may see prices.
visiblerequiredbooleanWhether prices are shown to this visitor at all.
displayModerequiredPriceDisplayModeThe basis prices are shown on.
gaterequiredPriceGateReason | nullWhy prices are hidden, or null when they are visible.
minimumOrderrequiredreadonly Money[]The visitor's minimum order value per currency; empty when there is none.
PriceBounds
The lowest and highest price of a product's variants.
minrequiredPriceViewThe lowest variant price.
maxrequiredPriceViewThe highest variant price.
PriceDisplayMode
Which basis prices are shown on: with tax, without tax, or without tax plus a tax note.
type PriceDisplayMode = 'gross' | 'net' | 'netPlusTax'PriceGateReason
Why prices are hidden from the visitor: they must sign in, or apply for a business account.
type PriceGateReason = 'signIn' | 'apply'PriceRef
The opaque key the storefront fills a live price into on pages with live prices.
__brandrequired'PriceRef'Keeps arbitrary strings from passing as a price ref; never read it.
PriceView
A price as a view model carries it; render it with the price parts.
resolved is null on pages with live prices (islands) or when the visitor may not see them.
refrequiredPriceRefThe key the host fills this price into.
resolvedrequiredResolvedPrice | nullThe worked-out price, or null when it is filled in by the host or hidden.
ResolvedPrice
A price worked out for the visitor's display mode, ready to show.
amountrequiredMoneyThe amount to show, on the visitor's display basis.
compareAtrequiredMoney | nullThe price before the markdown on the same basis, or null at full price.
discountPercentrequirednumber | nullThe markdown as a whole percentage (27 means 27 %), or null at full price.
grossrequiredMoneyThe amount with tax.
netrequiredMoney | nullThe amount without tax, or null when the market has no tax split.
taxIncludedrequiredbooleanWhether `amount` includes tax.
taxRatePercentrequirednumber | nullThe tax rate as a percentage, or null when rates are mixed or unknown.
unitrequiredUnitPriceInfo | nullThe unit price, or null when the product has no measured contents.
displayModerequiredPriceDisplayModeThe basis `amount` and `compareAt` are on.
UnitMeasure
A quantity with its unit, such as 500 g.
valuerequirednumberThe quantity.
unitrequiredMeasureUnitThe unit the quantity is in.
UnitPriceInfo
The price per base quantity the EU unit-pricing rules (98/6/EC) require, such as 4.20 per kg.
perAmountrequiredMoneyThe price of one `base` quantity.
measurerequiredUnitMeasureWhat the product contains.
baserequiredUnitMeasureThe quantity the unit price is quoted per.
UnitPricing
What a variant contains and the quantity its unit price is quoted per.
measurerequiredUnitMeasureWhat the variant contains, such as 500 g.
baserequiredUnitMeasureThe quantity the unit price is quoted per, such as 1 kg.
PriceProps
Props of Price, CompareAtPrice, DiscountBadge and UnitPrice.
pricerequiredPriceViewThe price of a product, variant or card.
classNamestringClasses added to the price.
noteClassNamestringClasses added to the net or plus-VAT note `Price` and `PriceRange` draw for a net-display buyer.
PriceRangeProps
Props of PriceRange.
pricerequiredPriceViewThe price of a product, variant or card.
classNamestringClasses added to the price.
noteClassNamestringClasses added to the net or plus-VAT note `Price` and `PriceRange` draw for a net-display buyer.
rangerequiredPriceBounds | nullThe lowest and highest variant prices; null draws `price` alone.
PriceNoteProps
Props of TaxNote and PriceGate.
classNamestringClasses added to the note.