Types: NotifyMeCopy to BundleGroup
The types of @poltura/theme-sdk/product, NotifyMeCopy to BundleGroup.
On this page
import { … } from '@poltura/theme-sdk/product';NotifyMeCopy
Texts of NotifyMe that replace the platform's own.
titlestringThe heading.
descriptionstringThe line under the heading.
emailLabelstringThe address field's label.
emailPlaceholderstringThe address field's placeholder.
submitstringThe button text.
submittingstringThe button text while sending.
newsletterstringIgnored: the newsletter box always shows the store's consent sentence.
successstringThe message once the request is in.
privacystringThe privacy line under the form.
NotifyMeProps
Props of NotifyMe.
variantIdrequiredstringThe variant to hear about.
reasonrequiredNotifyMeReasonWhy it cannot be bought now.
copyNotifyMeCopyTexts that replace the platform's own.
classNamestringClasses added to the form.
NotifyMeReason
Why a shopper asks to hear when a variant can be bought.
type NotifyMeReason = 'comingSoon' | 'preorderFull' | 'outOfStock'NotifyMeState
The state of a notify-me form: the address, the newsletter choice and the request.
enabledrequiredbooleanWhether the store sends stock notices at all.
emailrequiredstringThe address the notice goes to, the signed-in customer's by default.
setEmailrequired(email: string) => voidChanges the address.
newsletterrequiredbooleanWhether the shopper also subscribes to the newsletter.
consentrequiredstringThe store's marketing consent sentence: the newsletter box's label, held to every sign-up.
setNewsletterrequired(newsletter: boolean) => voidChanges the newsletter choice.
statusrequiredNotifyMeStatusWhere the request stands.
confirmationSentrequiredbooleanAfter `done`, whether a confirmation email was sent that the shopper must click first.
errorrequiredstring | nullWhy the request failed, in the page language, or null.
submitrequired() => Promise<NotifyMeStatus>Sends the request and resolves with the status it ends in.
NotifyMeStatus
Where a notify-me request stands.
type NotifyMeStatus = 'idle' | 'invalid' | 'submitting' | 'done' | 'error'ProductScopeProps
Props of ProductScope.
productrequiredProductThe product the code below is about.
childrenrequiredReactNodeThe code that reads the product.
ProductBuy
The buy box of the nearest product: the chosen variant, the quantity and adding it to the cart.
productrequiredProductThe product being bought.
variantrequiredVariant | nullThe chosen variant, or null while the choice matches none.
quantityrequirednumberThe quantity to add.
setQuantityrequired(quantity: number) => voidChanges the quantity to add.
canAddrequiredbooleanWhether the chosen variant can be added now.
isAddingrequiredbooleanWhether an add is under way.
errorrequiredstring | nullWhy the last add failed, in the page language, or null.
addrequired() => Promise<CartResult>Adds the chosen variant and quantity to the cart; on the product page also the personalisation, gift card and bundle filled in.
ctaLabelrequiredstringThe buy button's text: add to cart, pre-order or sold out, in the page language.
walletrequired{ readonly visible: boolean; }The express wallets of the product page.
wholesalerequiredWholesaleTiersView | nullA wholesale buyer's tier prices for the chosen variant, or null for everyone else.
personalizationrequiredPersonalizationState | nullThe texts the shopper fills in to personalise the item, or null when the product has none or the box is not the product page's.
giftCardrequiredGiftCardState | nullThe gift card's amount, recipient and delivery, or null for a product that is not a gift card or a box that is not the product page's.
bundlerequiredBundleSelectionState | nullThe bundle offered with the product and the shopper's choice in it, or null without an offer.
GalleryAspect
How a gallery frame crops its image.
type GalleryAspect = 'square' | 'portrait' | 'landscape' | 'natural'ProductGalleryImageProps
Props of ProductGalleryImage.
imagerequiredMediaImageRef | nullThe image, or null for the placeholder.
aspectGalleryAspectHow the frame crops the image; defaults to square.
prioritybooleanLoads the image first, for the one above the fold.
classNamestringClasses added to the frame.
ProductGalleryProps
Props of ProductGallery.
layout'grid' | 'carousel' | 'single'Every image stacked, one image with thumbnails, or the first image alone; defaults to the stack.
aspectGalleryAspectHow the frames crop the images; defaults to square.
classNamestringClasses added to the gallery.
ProductGalleryThumbsProps
Props of ProductGalleryThumbs.
imagesrequiredreadonly MediaImageRef[]The images, in order.
activerequirednumberThe index of the image shown.
onSelectrequired(index: number) => voidShows the image at an index.
classNamestringClasses added to the row.
BundleConfiguratorProps
Props of BundleConfigurator.
bundlerequiredBundleThe bundle to configure.
horizontalbooleanLays the items out in a row.
hideHeadingbooleanLeaves out the bundle's heading.
classNamestringClasses added to the configurator.
BundleSuggestionsProps
Props of BundleSuggestions.
bundlesrequiredreadonly Bundle[]The bundles to suggest, best first.
activeBundleIdrequiredstring | nullThe id of the bundle being configured, which shows as selected.
onSelectBundlerequired(bundleId: string) => voidCalled with the id of the bundle the shopper chose to configure.
classNamestringClasses added to the panel.
Bundle
A bundle: products sold together at a saving.
idrequiredstringThe bundle's id.
titlerequiredstringThe bundle's title.
moderequiredBundleModeHow the bundle sells.
headingrequiredstring | nullThe merchant's heading for the offer, or null.
subtextrequiredstring | nullThe merchant's line under the heading, or null.
badgerequiredstring | nullThe merchant's badge text, such as "Save 15%", or null.
productIdrequiredstringThe product the bundle is offered with.
currencyCoderequiredstring | nullThe currency of the bundle's amounts, or null while unknown.
groupsrequiredreadonly BundleGroup[]The groups items are chosen in.
itemsrequiredreadonly BundleItem[]The items, in the merchant's order.
BundleGroup
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.