price
Money, prices and price access: what a visitor may see and on which tax basis.
On this page
import { … } from '@poltura/theme-sdk/price';Hooks
| Name | What it is |
|---|---|
usePrice | The amounts behind a price, for code that must compute with them. |
usePriceAccess | Whether the visitor may see prices, on which tax basis, and what unlocks them when hidden. |
Parts
| Name | What it is |
|---|---|
Price | The price a shopper pays, on the visitor's tax basis, filled in per visitor on pages with live prices. |
PriceRange | The lowest to highest price across a product's variants, or its single price when they agree. |
CompareAtPrice | The struck-through price before the markdown; nothing at full price. |
DiscountBadge | The markdown as a percentage label such as -20%; nothing at full price. |
UnitPrice | The price per base measure, such as "12 900 Ft / kg", the EU unit price rule asks for. |
TaxNote | "+ VAT" or "net" beside prices for a visitor who sees net prices; nothing on gross. |
PriceGate | The sign-in or apply link shown instead of prices to visitors the store hides them from. |
Types
| Name | What it is |
|---|---|
MeasureUnit | A unit a product's contents or a unit price is measured in. |
Money | An amount of money in major units (12.99, not 1299). |
PriceAccess | Whether and how the current visitor may see prices. |
PriceBounds | The lowest and highest price of a product's variants. |
PriceDisplayMode | Which basis prices are shown on: with tax, without tax, or without tax plus a tax note. |
PriceGateReason | Why prices are hidden from the visitor: they must sign in, or apply for a business account. |
PriceRef | The opaque key the storefront fills a live price into on pages with live prices. |
PriceView | A price as a view model carries it; render it with the price parts. |
ResolvedPrice | A price worked out for the visitor's display mode, ready to show. |
UnitMeasure | A quantity with its unit, such as 500 g. |
UnitPriceInfo | The price per base quantity the EU unit-pricing rules (98/6/EC) require, such as 4.20 per kg. |
UnitPricing | What a variant contains and the quantity its unit price is quoted per. |
PriceProps | Props of Price, CompareAtPrice, DiscountBadge and UnitPrice. |
PriceRangeProps | Props of PriceRange. |
PriceNoteProps | Props of TaxNote and PriceGate. |