Fejlesztőknek
Kezdj bele
Témák/Theme SDK/Modules/product

product

Ez az oldal még csak angolul érhető el.

Products, variants, options, availability, specifications, reviews, the product page view and the buy box.

Ezen az oldalon
import { … } from '@poltura/theme-sdk/product';

Hooks

NameWhat it is
useVariantPickerThe variant picker of the nearest product: its options, the choice and the variant it picks.
useProductGalleryThe gallery state of the nearest product, which moves to the picked variant's first image.
useBundleSelectionThe bundle offered with the product page's product and the shopper's choice in it.
useNotifyMeThe form state behind NotifyMe, for a theme drawing its own notify-me form.
useNearestProductThe product the code sits under: the product page's, a product card's or a ProductScope's.
useProductBuyThe buy box state of the nearest product, shared by every part of the box.
useBundleQuoteThe price of a bundle with the shopper's choice in it, refreshed before it lapses.
useBundleRecommendationsThe bundles recommended for a product, best first, for the shopper's cart.
useProductBundlesThe bundles that include the given products, by product id.
useRelatedProductsRelated product cards: the merchant's picks, then automatic recommendations when switched on, then popular products of the category and the store.
useWishlistThe shopper's favourites: how many, which products, and a toggle. A signed-in shopper's list lives in their account and a guest's in the browser.
useOptionalProductPageThe product page's view, or null where no product page is drawn, such as a product shown inside another page.
useProductPageThe product page with everything it shows beyond the product: the trail, highlights, specifications, guides, warranty, safety, coverage and the first reviews.
useProductTabsThe tabs the nearest product page shows, in the merchant's order.
useProductTableLinksThe nearest product's link tables, sorted onto its variant picker options.
useProductTablesThe tables attached to the nearest product, optionally only those the merchant placed one way.
useReviewsThe reviews of one or several products, one page at a time, with the review score over all of them.
useSubmitReviewSending a shopper's review of a product, with the bot check and the refresh of the shown reviews.

Parts

NameWhat it is
VariantOptionOne option of the picker with its name, laying its values out as buttons, swatches, tiles or a dropdown.
VariantOptionValueOne value of an option: a button, a swatch, an image tile or a dropdown entry, following its option.
VariantSwatchThe colour, split colour or image fill of an option value's swatch.
QuantityStepperThe quantity field with minus and plus, snapping typed amounts to the order limits and naming them.
AddToCartButtonThe buy box's add to cart button with the error of the last attempt under it.
WalletButtonsApple Pay, Google Pay and the other express wallets of the product page, mounted in the browser.
WholesaleTiersA wholesale buyer's tier price, list price and quantity breaks, the chosen quantity's break highlighted.
AvailabilityBadge"Pre-order", "Coming soon" or "Sold out" for a pre-order state; nothing for plain stock states.
PersonalizationFieldsThe texts the shopper fills in to personalise the product page's item, such as an engraving.
GiftCardFieldsA gift card product's amount, recipient, message and send date.
ProductScopeMakes a product the nearest one for everything inside, with its own variant choice and quantity.
ProductGalleryImageOne framed gallery image, cropped to the aspect, or the placeholder when there is none.
ProductGalleryThumbsA row of thumbnails, the shown image's marked, each showing its image when pressed; nothing for fewer than two images.
BundleConfiguratorA standalone bundle: its items with the choice among them, the live price and an add-the-bundle-to-cart button.
BundleSuggestionsA panel of bundle offers with their saving, the reason each is suggested and a configure button.
WishlistButtonA heart button that saves a product to the shopper's favourites and takes it out again; nothing when the store has favourites turned off.
WishlistLinkA heart with the number of saved products, linking to the shopper's favourites page; nothing when the store has favourites turned off.
ProductBadgesA product's badges as colour-coded labels; nothing without badges.
ProductKeySpecsThe attributes the store shows by the product title, such as a game's platform: a small name over its values with their icons; nothing without any.
ProductSharePanelA share dialog with copy-link, email, WhatsApp, Facebook, X and the device's own share sheet.
ProductSpecsThe specification table: a titled section per group with a row of name and value each; nothing without rows.
SpecValueLabelOne attribute value as the shopper reads it: its icon or logo beside the text.
SpecValuesAll values of one attribute, each with its icon, side by side and wrapping; nothing for an attribute without values.
ProductTableLinkA link opening a table sheet: at the side, or from the bottom on phones.
ProductTableViewOne product table in place: its intro, the unit switch, the table and the measuring guide; the chosen variant's row is highlighted.
ProductTabContentOne tab's content. The description with its keywords, the specification table, the guides and downloads, the warranty, the merchant's text or a product table.
ProductTrustBadgeThe trust badge an installed review app draws on the product page, such as the store's rating with that app; nothing when no app offers one.
RatingStarsFive stars with as many filled as the rating rounds to.
RatingSummaryThe average rating large, with the stars and a bar per star rating showing how many reviews gave it.
ReviewCardOne review: the reviewer's shortened name and initials, the verified badge, the date, the stars, the title and the text.
ReviewFormThe write-a-review form: a star picker, name, email, title and text, a thank-you once sent and a product picker for a bundle.
ReviewSkeletonThree placeholder cards shaped like ReviewCard, for the time the reviews load.
ReviewsEmptyThe message for a product without reviews, with a button that asks for the first one.
ReviewsFooterThe load-more button under a review list, or the count of reviews seen once there are no more.
ReviewsHeaderThe reviews heading with the review count and a write-a-review button.

Defaults

NameWhat it is
VariantPickerThe complete variant picker of the nearest product, built from its parts.
BundleSelectorThe complete bundle offer of the product page: its items, groups, suggested sets and savings.
NotifyMe"Notify me" for a variant that cannot be bought now: one email, sent once when it can be.
ProductGalleryThe nearest product's gallery, following the picked variant's image.
ProductDetailsThe product's key attributes, then where it can be activated and whether it works in the shopper's country; nothing for a product with neither.
ProductHeaderThe product page's heading block: tags, the title, the maker and SKU, and the rating with its review count.
ProductHighlightsThe merchant's highlighted selling points as a two-column list with chevrons; nothing without any.
ProductTabsThe product page's tabs as the merchant arranged them: built-in content, their own text and product tables; nothing when all are empty.
ReviewsThe complete reviews panel: heading, score, the reviews with load more, and the write-a-review form.

Constants

NameWhat it is
productRegionsThe regions of the product page's main section, for Slot.

Types

NameWhat it is
AvailabilityWhether and how a product or variant can be bought, with its label in the page language.
BundleRefThe fixed bundle a product card sells as one item.
CountryLabelA country with its name in the page language.
ExpectedDateWhen a pre-ordered or upcoming product is expected to ship.
ExpectedPrecisionHow exact a promised date is.
GiftCardKindWhether a gift card product is loaded with an amount or redeems for a set item.
PersonalizationFieldA text the shopper fills in to personalise their item, such as an engraving.
ProductA product with everything a product page shows of it.
ProductBadgeA merchant-managed label on a product, such as "New" or "Sale", already in the page language.
ProductCoverageWhere a region-locked product, such as a licence key, can be used.
ProductOptionA choice the shopper makes to pick a variant, such as colour or size.
ProductOptionDisplayHow the picker presents an option's values.
ProductOptionValueOne value of a product option, such as "Red".
ProductPageViewEverything a product page shows beyond the product itself.
ProductSafetyWhat the EU product safety rules (2023/988, Art. 19) require a listing to show.
ProductSafetyContactWho answers for a product's safety.
ProductTabA product page tab. A built-in one, the merchant's text, or a table.
ProductTabBuiltinA built-in tab's content: what the product already holds.
ProductTableA product table. A size chart, nutrition facts or specifications.
ProductTableColumnOne column of a product table, such as a measurement.
ProductTableColumnTypeHow a column's cells read.
ProductTablePlacementWhere a table shows.
ProductTableRowOne row of a product table, such as a size.
ProductTabsDisplayTabs or an accordion. A tab bar, or one heading per tab.
ProductWarrantyThe warranty that comes with a product.
RatingCountHow many reviews gave one star rating.
RatingStatsA product's review score.
ReviewA published review of a product.
ReviewPageOne page of a product's reviews with its score.
ReviewPolicyHow the store checks reviews, from its own settings.
SpecOne row of a product's specification table.
SpecGroupA titled section of a product's specification table.
SpecValueOne value of a spec as the shopper reads it.
SwatchThe swatch a variant option value shows instead of a text button.
UnavailableReasonWhy a variant cannot be bought right now.
VariantOne buyable version of a product, such as the red one in size M.
VariantPickerValueOne value of an option in the variant picker, with what choosing it would lead to.
VariantPickerOptionOne option of the variant picker, such as colour or size.
VariantPickerStateThe variant picker's state: the options with their values, the current choice and the variant it picks.
VariantPickerClassesClass names for the pieces of VariantPicker and VariantOption.
VariantPickerPropsProps of VariantPicker.
VariantOptionPropsProps of VariantOption.
VariantOptionValuePropsProps of VariantOptionValue.
VariantSwatchPropsProps of VariantSwatch.
ProductGalleryStateThe image viewer of a product page: its images, the one shown and the zoomed view.
QuantityStepperPropsProps of QuantityStepper.
AddToCartButtonPropsProps of AddToCartButton.
WalletButtonsPropsProps of WalletButtons.
WholesaleBreakOne quantity break of a wholesale price list.
WholesaleTiersViewWhat a wholesale buyer sees beside the price: the list price and the quantity breaks.
WholesaleTiersPropsProps of WholesaleTiers.
AvailabilityBadgePropsProps of AvailabilityBadge.
BuyFieldsPropsProps of PersonalizationFields and GiftCardFields.
BundleSelectionGroupA group of bundle items the shopper picks a number of, such as "Choose 2 sauces".
BundleSelectionItemOne item a bundle offers with the product page's product.
BundleSelectionStateThe bundle offered on the product page and the shopper's choice in it.
BundleSelectorPropsProps of BundleSelector.
NotifyMeCopyTexts of NotifyMe that replace the platform's own.
NotifyMePropsProps of NotifyMe.
NotifyMeReasonWhy a shopper asks to hear when a variant can be bought.
NotifyMeStateThe state of a notify-me form: the address, the newsletter choice and the request.
NotifyMeStatusWhere a notify-me request stands.
ProductScopePropsProps of ProductScope.
ProductBuyThe buy box of the nearest product: the chosen variant, the quantity and adding it to the cart.
GalleryAspectHow a gallery frame crops its image.
ProductGalleryImagePropsProps of ProductGalleryImage.
ProductGalleryPropsProps of ProductGallery.
ProductGalleryThumbsPropsProps of ProductGalleryThumbs.
BundleConfiguratorPropsProps of BundleConfigurator.
BundleSuggestionsPropsProps of BundleSuggestions.
BundleA bundle: products sold together at a saving.
BundleGroupA group of bundle items the shopper picks a number of, such as "Choose 2 sauces".
BundleItemOne item a bundle holds.
BundleQuoteThe price of a bundle with the shopper's choice in it.
BundleQuoteInputWhat to price: one bundle with the shopper's choice in it.
BundleQuoteRefusalWhy a bundle could not be priced.
BundleRecommendationA bundle recommended for a product, with the choice that suits the shopper and its price.
BundleRecommendationReasonWhy a bundle is recommended with the product.
WishlistButtonPropsProps of WishlistButton.
WishlistLinkPropsProps of WishlistLink.
WishlistProductThe product a toggle saves or removes.
WishlistStateThe shopper's favourites.
GiftCardDraftWhat the shopper fills in to send a gift card.
GiftCardIssueWhy a gift card field is not accepted.
GiftCardStateA gift card product's amount, recipient and delivery as the shopper fills them in.
PersonalizationIssueWhy a personalisation text is not accepted.
PersonalizationStateThe personalisation texts of the product page's item and what the shopper has typed.
ProductBadgesPropsProps of ProductBadges.
ProductDetailsPropsProps of ProductDetails.
ProductHeaderPropsProps of ProductHeader.
ProductHighlightsPropsProps of ProductHighlights.
ProductKeySpecsPropsProps of ProductKeySpecs.
ProductSharePanelPropsProps of ProductSharePanel.
ProductSpecsPropsProps of ProductSpecs.
ProductTabContentPropsProps of ProductTabContent.
ProductTableLinkPropsProps of ProductTableLink.
ProductTableLinksLink tables by option: where they show in the variant picker.
ProductTableViewPropsProps of ProductTableView.
ProductTabsPropsProps of ProductTabs.
SpecValueLabelPropsProps of SpecValueLabel.
SpecValuesPropsProps of SpecValues.
RatingStarsPropsProps of RatingStars.
RatingSummaryPropsProps of RatingSummary.
ReviewCardPropsProps of ReviewCard.
ReviewFormPropsProps of ReviewForm.
ReviewInputWhat a shopper fills in to review a product.
ReviewResultHow sending a review ended.
ReviewSkeletonPropsProps of ReviewSkeleton.
ReviewTargetThe product a review is written for; a bundle lets the shopper choose among its products.
ReviewsByWhich product or products a review list is about.
ReviewsEmptyPropsProps of ReviewsEmpty.
ReviewsFooterPropsProps of ReviewsFooter.
ReviewsHeaderPropsProps of ReviewsHeader.
ReviewsPropsProps of Reviews.
SubmitReviewStateThe state of sending a review.
Utoljára frissítve