Developers
Start building
Themes/Theme SDK/Modules/price/Types

Types

The types of @poltura/theme-sdk/price.

On this page
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).

amountrequirednumber

The amount in major units.

currencyCoderequiredCurrencyCode

The currency of the amount.

PriceAccess

Whether and how the current visitor may see prices.

visiblerequiredboolean

Whether prices are shown to this visitor at all.

displayModerequiredPriceDisplayMode

The basis prices are shown on.

gaterequiredPriceGateReason | null

Why 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.

minrequiredPriceView

The lowest variant price.

maxrequiredPriceView

The 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.

refrequiredPriceRef

The key the host fills this price into.

resolvedrequiredResolvedPrice | null

The 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.

amountrequiredMoney

The amount to show, on the visitor's display basis.

compareAtrequiredMoney | null

The price before the markdown on the same basis, or null at full price.

discountPercentrequirednumber | null

The markdown as a whole percentage (27 means 27 %), or null at full price.

grossrequiredMoney

The amount with tax.

netrequiredMoney | null

The amount without tax, or null when the market has no tax split.

taxIncludedrequiredboolean

Whether `amount` includes tax.

taxRatePercentrequirednumber | null

The tax rate as a percentage, or null when rates are mixed or unknown.

unitrequiredUnitPriceInfo | null

The unit price, or null when the product has no measured contents.

displayModerequiredPriceDisplayMode

The basis `amount` and `compareAt` are on.

UnitMeasure

A quantity with its unit, such as 500 g.

valuerequirednumber

The quantity.

unitrequiredMeasureUnit

The 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.

perAmountrequiredMoney

The price of one `base` quantity.

measurerequiredUnitMeasure

What the product contains.

baserequiredUnitMeasure

The quantity the unit price is quoted per.

UnitPricing

What a variant contains and the quantity its unit price is quoted per.

measurerequiredUnitMeasure

What the variant contains, such as 500 g.

baserequiredUnitMeasure

The quantity the unit price is quoted per, such as 1 kg.

PriceProps

Props of Price, CompareAtPrice, DiscountBadge and UnitPrice.

pricerequiredPriceView

The price of a product, variant or card.

classNamestring

Classes added to the price.

noteClassNamestring

Classes added to the net or plus-VAT note `Price` and `PriceRange` draw for a net-display buyer.

PriceRangeProps

Props of PriceRange.

pricerequiredPriceView

The price of a product, variant or card.

classNamestring

Classes added to the price.

noteClassNamestring

Classes added to the net or plus-VAT note `Price` and `PriceRange` draw for a net-display buyer.

rangerequiredPriceBounds | null

The lowest and highest variant prices; null draws `price` alone.

PriceNoteProps

Props of TaxNote and PriceGate.

classNamestring

Classes added to the note.

Last updated