Types: VariantOptionProps to BundleSelectorProps
The types of @poltura/theme-sdk/product, VariantOptionProps to BundleSelectorProps.
On this page
import { … } from '@poltura/theme-sdk/product';VariantOptionProps
Props of VariantOption.
optionrequiredVariantPickerOptionThe option.
displayProductOptionDisplayHow to show the values; the option's own display by default.
showTitlebooleanShows the option's name; on by default, and kept for screen readers when off.
childrenrequiredReactNodeThe option's values, as {@link VariantOptionValue} parts.
titleSlotReactNodeContent aligned to the end of the option's title row, such as a size guide link.
classesVariantPickerClassesClasses added to the pieces; `value` is applied by {@link VariantPicker}, not here.
classNamestringClasses added to the option.
VariantOptionValueProps
Props of VariantOptionValue.
valuerequiredVariantPickerValueThe value.
onSelectrequired() => voidChooses the value.
classNamestringClasses added to the value.
VariantSwatchProps
Props of VariantSwatch.
swatchrequiredSwatchThe swatch to draw.
classNamestringClasses added to the swatch.
ProductGalleryState
The image viewer of a product page: its images, the one shown and the zoomed view.
imagesrequiredreadonly MediaImageRef[]The product's images, in order.
activerequirednumberThe index of the image shown.
selectrequired(index: number) => voidShows the image at an index.
nextrequired() => voidShows the next image, from the last back to the first.
previousrequired() => voidShows the previous image, from the first on to the last.
zoomrequired{ readonly open: boolean; show(): void; close(): void; }The full-screen view of the shown image.
QuantityStepperProps
Props of QuantityStepper.
valuerequirednumberThe quantity.
minnumber | nullThe fewest that may be ordered, or null for one.
maxnumber | nullThe most that may be ordered, or null for no limit.
stepnumber | nullThe pack size quantities move in, or null for one.
inCartnumberHow many the cart already holds, which the limits count.
onChangerequired(next: number) => voidReceives the new quantity, already within the limits.
classNamestringClasses added to the stepper.
AddToCartButtonProps
Props of AddToCartButton.
labelrequiredstringThe button text, such as "Add to cart" or "Pre-order".
onAddrequired() => voidAdds the item to the cart.
disabledbooleanWhether the item cannot be added now.
busybooleanWhether the item is being added.
errorstring | nullWhy the last add failed, shown under the button, or null.
fullWidthbooleanStretches the button over its row.
classNamestringClasses added to the button.
WalletButtonsProps
Props of WalletButtons.
classNamestringClasses added to the wallet row.
WholesaleBreak
One quantity break of a wholesale price list.
minQuantityrequirednumberThe quantity the break starts at.
unitPricerequiredMoneyOne unit's price from that quantity on.
WholesaleTiersView
What a wholesale buyer sees beside the price: the list price and the quantity breaks.
listPricerequiredMoney | nullThe consumer price when the buyer's is lower, otherwise null.
unitPricerequiredMoneyOne unit's price below the first break.
breaksrequiredreadonly WholesaleBreak[]The quantity breaks, smallest first.
tierOnlyrequiredbooleanWhether the product is sold to wholesale buyers only.
basisrequired'gross' | 'net'Whether the amounts are net or gross.
WholesaleTiersProps
Props of WholesaleTiers.
tiersrequiredWholesaleTiersViewThe buyer's tier prices.
quantitynumberThe quantity chosen, whose break is highlighted.
classNamestringClasses added to the tiers.
AvailabilityBadgeProps
Props of AvailabilityBadge.
availabilityrequiredAvailabilityThe product's or variant's availability.
classNamestringClasses added to the badge.
BuyFieldsProps
Props of PersonalizationFields and GiftCardFields.
classNamestringClasses added to the fields.
BundleSelectionGroup
A group of bundle items the shopper picks a number of, such as "Choose 2 sauces".
idrequiredstringThe group's id.
labelrequiredstringThe group's label in the page language.
minrequirednumberThe fewest items to choose.
maxrequirednumberThe most items to choose.
chosenrequirednumberHow many are chosen.
completerequiredbooleanWhether the choice meets the group's limits.
BundleSelectionItem
One item a bundle offers with the product page's product.
idrequiredstringThe bundle item's id; pass it to `toggle`.
productIdrequiredstringThe item's product id.
variantIdrequiredstringThe item's variant id.
titlerequiredstringThe item's product title.
variantTitlerequiredstring | nullThe variant's title, or null for a single-variant product.
imagerequiredMediaImageRef | nullThe item's image, or null.
quantityrequirednumberHow many of it the bundle holds.
groupIdrequiredstring | nullThe group the item is chosen in, or null for an ungrouped item.
optionalrequiredbooleanWhether the shopper may leave it out.
selectedrequiredbooleanWhether it is chosen.
selectablerequiredbooleanWhether choosing it now keeps the bundle within its limits.
BundleSelectionState
The bundle offered on the product page and the shopper's choice in it.
bundleIdrequiredstringThe bundle's id.
titlerequiredstringThe bundle's title.
moderequiredBundleModeHow the bundle sells.
offersrequiredreadonly { readonly id: string; readonly title: string; }[]The other bundles the product is offered in, this one included.
chooseOfferrequired(bundleId: string) => voidSwitches to another offer.
itemsrequiredreadonly BundleSelectionItem[]The items, in the merchant's order.
groupsrequiredreadonly BundleSelectionGroup[]The groups items are chosen in.
togglerequired(itemId: string, next: boolean) => voidChooses or leaves out an item.
completerequiredbooleanWhether the choice makes a complete bundle.
savingsrequiredMoney | nullWhat the choice saves against buying the items alone, or null while unknown.
quoterequired{ readonly status: 'loading' | 'ready' | 'unavailable'; readonly total: Money | null; readonly compareAt: Money | null; }The priced choice: `loading` while the host prices it, `unavailable` when it cannot.
BundleSelectorProps
Props of BundleSelector.
classNamestringClasses added to the selector.
placement'aside' | 'below'Where the offer sits: `aside` in the buy box (the default), or `below` across the page under both columns.