Developers
Start building
Themes/Theme SDK/Modules/product/Types: Review to VariantPickerProps

Types: Review to VariantPickerProps

The types of @poltura/theme-sdk/product, Review to VariantPickerProps.

On this page
import { … } from '@poltura/theme-sdk/product';

Review

A published review of a product.

idrequiredstring

The review's id.

productIdrequiredstring

The product the review is about.

authorrequiredstring

The reviewer's display name.

ratingrequirednumber

The star rating, from 1 to 5.

titlerequiredstring

The review's title.

bodyrequiredstring

The review's text.

verifiedPurchaserequiredboolean

Whether the reviewer bought the product from the store.

storeReply{ readonly body: string; readonly createdAt: string | null; } | null

The store's public reply under the review; the review itself is always the customer's.

createdAtrequiredstring

When the review was written, as an ISO 8601 instant.

source'store' | 'imported'

Where the review was written: in this store, or imported from another platform; absent reads as `store`.

sourceLabelstring | null

An imported review's source line in the page language ("Imported from Trustpilot"), shown in place of the verified mark; else null.

ReviewPage

One page of a product's reviews with its score.

reviewsrequiredreadonly Review[]

The reviews on this page, newest first.

statsrequiredRatingStats

The product's review score over every review.

pagerequirednumber

The page number, from 1.

pageCountrequirednumber

How many pages there are.

policyReviewPolicy

How the store checks reviews before they appear, which the review block states.

ReviewPolicy

How the store checks reviews, from its own settings.

checkedrequired'all' | 'unverified' | 'verified' | 'none'

Which reviews wait for the store's check: every one, the unverified, the verified or none.

checkedBelowRatingrequirednumber | null

Reviews under this many stars also wait for a check; null when no rating rule is set.

importedboolean

Some reviews were imported from another platform, unchecked by the store.

rewardedboolean

Writing a review can earn loyalty points, whatever the rating.

statementreadonly string[]

The store's review statement in the page language, one sentence each, to show under the score as `RatingSummary` does.

Spec

One row of a product's specification table.

handlerequiredstring

The attribute's stable key, for styling or picking one row.

labelrequiredstring

The attribute's name in the page language.

valuesrequiredreadonly string[]

The raw values, one per entry.

itemsrequiredreadonly SpecValue[]

The values with their icons, one per entry of `values`, in the same order.

displayrequiredstring

The values formatted for display, with units and the locale's numbers.

unitrequiredstring | null

The unit the values are in, or null.

SpecGroup

A titled section of a product's specification table.

idrequiredstring | null

The group's id, or null for the ungrouped rows.

labelrequiredstring | null

The group's title, or null for the ungrouped rows, which come first.

specsrequiredreadonly Spec[]

The group's rows.

SpecValue

One value of a spec as the shopper reads it.

labelrequiredstring

The value's text in the page language.

iconrequiredIconValue | null

The icon shown beside the label, as `ContentIcon` draws it (a platform logo such as `logo:steam`, a content icon or an uploaded SVG), or null.

Swatch

The swatch a variant option value shows instead of a text button.

colorrequiredstring | null

The swatch colour as `#rrggbb`, or null when it is an image.

color2requiredstring | null

A second colour for a split swatch, or null.

imagerequiredMediaImageRef | null

A pattern or photo swatch, or null when it is a colour.

UnavailableReason

Why a variant cannot be bought right now.

type UnavailableReason = 'outOfStock' | 'preorderFull' | 'paused' | 'restricted'

Variant

One buyable version of a product, such as the red one in size M.

idrequiredstring

The variant's id; pass it to the cart.

titlerequiredstring

The variant's title, such as "Red / M".

skurequiredstring | null

The stock keeping unit, or null.

optionsrequiredReadonly<Record<string, string>>

The chosen value id per option id.

pricerequiredPriceView

The variant's price.

availabilityrequiredAvailability

Whether and how the variant can be bought.

imageIdsrequiredreadonly string[]

Ids of the product images that show this variant, first one leading.

unitPricingrequiredUnitPricing | null

The variant's contents and unit-price base, or null when it has no measured contents.

VariantPickerValue

One value of an option in the variant picker, with what choosing it would lead to.

idrequiredstring

The value's id.

labelrequiredstring

The value in the page language.

swatchrequiredSwatch | null

The value's swatch, or null when it has none.

selectedrequiredboolean

Whether the value is the current choice.

selectablerequiredboolean

Whether choosing it can still lead to a variant that can be bought.

availabilityrequiredAvailability | null

The availability of the variant this value completes with the other choices, or null when none does.

VariantPickerOption

One option of the variant picker, such as colour or size.

idrequiredstring

The option's id.

titlerequiredstring

The option's name in the page language.

displayrequiredProductOptionDisplay

How the merchant asked the values to be shown.

valuesrequiredreadonly VariantPickerValue[]

The values, in the merchant's order.

VariantPickerState

The variant picker's state: the options with their values, the current choice and the variant it picks.

optionsrequiredreadonly VariantPickerOption[]

The options that pick a variant; empty for a single-variant product or outside a product.

selectrequired(optionId: string, valueId: string) => void

Chooses a value of an option.

selectedrequiredReadonly<Record<string, string>>

The chosen value id per option id.

variantrequiredVariant | null

The variant the choice picks, or null while the choice matches none.

VariantPickerClasses

Class names for the pieces of VariantPicker and VariantOption.

optionstring

Each option, its name and values together.

titlestring

Each option's name.

valuesstring

The row or dropdown holding an option's values.

valuestring

Each value; set by {@link VariantPicker}.

VariantPickerProps

Props of VariantPicker.

display'auto' | 'dropdown'

`dropdown` shows every option as a dropdown; `auto` follows each option's own display.

showTitlesboolean

Shows each option's name above its values; on by default.

boxedboolean

Draws the picker in a card box.

classesVariantPickerClasses

Classes added to the pieces.

classNamestring

Classes added to the picker.

Last updated