Types: BundleItem to PersonalizationIssue
The types of @poltura/theme-sdk/product, BundleItem to PersonalizationIssue.
Ezen az oldalon
import { … } from '@poltura/theme-sdk/product';BundleItem
One item a bundle holds.
idrequiredstringThe bundle item's id; quotes and selections name it.
productIdrequiredstringThe item's product id.
productHandlerequiredstring | nullThe item's product URL segment, or null.
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.
BundleQuote
The price of a bundle with the shopper's choice in it.
acceptedrequiredtrueThe bundle was priced.
BundleQuoteInput
What to price: one bundle with the shopper's choice in it.
bundleIdrequiredstringThe bundle's id.
variantIdstringThe variant of the product the bundle is offered with, when it has several.
itemsreadonly { readonly itemId: string; readonly variantId?: string; readonly quantity?: number; }[]The chosen items; all of them when omitted.
quantitynumberHow many bundles; one by default.
BundleQuoteRefusal
Why a bundle could not be priced.
type BundleQuoteRefusal = 'stale' | 'expired' | 'currencyMismatch' | 'missingPrice' | 'invalidSelection' | 'inactive' | 'invalidPolicy' | 'unavailable'BundleRecommendation
A bundle recommended for a product, with the choice that suits the shopper and its price.
bundleIdrequiredstringThe bundle's id.
titlerequiredstringThe bundle's title.
reasonrequiredBundleRecommendationReasonWhy it is recommended.
itemsrequiredreadonly { readonly itemId: string; readonly variantId: string; readonly quantity: number; }[]The recommended items and their quantities, by bundle item id.
totalrequiredMoneyThe price of the recommended choice.
compareAtrequiredMoneyThe price of the same items bought alone.
BundleRecommendationReason
Why a bundle is recommended with the product.
type BundleRecommendationReason = 'completeTheSet' | 'boughtTogether' | 'bundleAndSave' | 'rewardOffer'WishlistButtonProps
Props of WishlistButton.
productIdrequiredstringThe id of the product the heart saves.
titlerequiredstringThe product's title; it names the button for assistive technology and the saved product in analytics.
categoryLabelstring | nullThe product's category name, recorded with the save in analytics.
pricePriceViewThe price recorded with the save in analytics; a card's `price`.
placement'card' | 'page'`card` draws a round heart over a card's top-right image corner; `page` a square bordered one for a buy row.
classNamestringClasses added to the button.
WishlistLinkProps
Props of WishlistLink.
showCountbooleanWhether the number of saved products shows on the heart; true by default.
classNamestringClasses added to the link.
WishlistProduct
The product a toggle saves or removes.
idrequiredstringThe product's id.
titlerequiredstringThe product's title, recorded with a save in analytics.
WishlistState
The shopper's favourites.
enabledrequiredbooleanWhether the store has favourites turned on; when false nothing about favourites should show.
countrequirednumberHow many products are saved.
isSavedrequired(productId: string) => booleanWhether the product is saved.
togglerequired(product: WishlistProduct) => Promise<boolean>Saves a product that is not saved and removes one that is.
GiftCardDraft
What the shopper fills in to send a gift card.
recipientrequired'someone' | 'self'Whether the card is for someone else or for the shopper.
recipientNamerequiredstringThe recipient's name.
recipientEmailrequiredstringThe address the card is sent to.
senderNamerequiredstringThe name the card comes from.
messagerequiredstringThe message on the card.
deliveryrequired'now' | 'schedule'Whether the card goes out at once or on `sendOn`.
sendOnrequiredstringThe day the card goes out, as `YYYY-MM-DD`, when delivery is scheduled.
GiftCardIssue
Why a gift card field is not accepted.
type GiftCardIssue = 'required' | 'invalidEmail' | 'messageTooLong' | 'schedulingDisabled' | 'sendInPast' | 'sendTooFar'GiftCardState
A gift card product's amount, recipient and delivery as the shopper fills them in.
kindrequiredGiftCardKindWhether the card is loaded with an amount or redeems for a set item.
draftrequiredGiftCardDraftWhat the shopper has filled in.
setDraftrequired(patch: Partial<GiftCardDraft>) => voidChanges parts of the draft.
issuesrequiredReadonly<Partial<Record<'recipientEmail' | 'message' | 'sendOn', GiftCardIssue>>>What is wrong with a field; shown once the shopper tries to add the card.
messageMaxrequirednumberThe longest message accepted.
canSchedulerequiredbooleanWhether the merchant lets cards be sent on a later day.
amountsrequiredreadonly { readonly variantId: string; readonly amount: Money; readonly label: string; }[]The amounts to choose from, priced in the shopper's currency; empty for a voucher.
selectedVariantIdrequiredstring | nullThe variant of the chosen amount, or null.
selectAmountrequired(variantId: string) => voidChooses an amount.
voucherrequired{ readonly title: string; readonly href: string | null; } | nullThe item a voucher redeems for, or null for an amount card.
PersonalizationIssue
Why a personalisation text is not accepted.
type PersonalizationIssue = 'required' | 'tooLong'