Types: ProductPageView to RatingStats
The types of @poltura/theme-sdk/product, ProductPageView to RatingStats.
On this page
import { … } from '@poltura/theme-sdk/product';ProductPageView
Everything a product page shows beyond the product itself.
productrequiredProductThe product.
breadcrumbsrequiredreadonly BreadcrumbItem[]The trail from the home page to the product.
descriptionMarkdownrequiredstring | nullThe product description as the merchant wrote it, Markdown that may hold HTML, as `Markdown` from the content module draws it; null without one.
descriptionAiGeneratedrequiredbooleanWhether AI wrote the description; `Markdown` from the content module marks it in the page by itself.
highlightsrequiredreadonly string[]The merchant's highlighted selling points.
specGroupsrequiredreadonly SpecGroup[]The specification table.
keySpecsrequiredreadonly Spec[]The attributes the store shows by the title, such as a game's platform; empty when none apply.
guidesrequiredreadonly Guide[]Guides that belong to the product.
downloadsrequiredreadonly GuideAttachment[]Every file and link the guides tab lists: the product's own first, then each guide's, in order.
filesrequiredreadonly ProductFile[]The files buyers download after purchase, product-wide ones first; empty when it delivers none.
warrantyrequiredProductWarranty | nullThe warranty, or null.
safetyrequiredProductSafety | nullThe safety information, or null.
coveragerequiredProductCoverage | nullWhere the product can be used, or null when it is not region-locked.
tablesrequiredreadonly ProductTable[]The tables attached to the product, strongest first; empty when it has none.
tabsrequiredreadonly ProductTab[]The tabs under the product in the merchant's order, without the ones that have nothing to show for this product.
reviewsSeedrequiredReviewPage | nullThe first page of reviews, read with the page, or null.
reviewTargetrequiredReviewTargetWhose reviews the page shows and the review form asks about: the product, or each item of its bundle.
ProductSafety
What the EU product safety rules (2023/988, Art. 19) require a listing to show.
manufacturerrequiredProductSafetyContact | nullThe manufacturer, or null.
responsiblePersonrequiredProductSafetyContact | nullThe person responsible in the EU, or null.
informationrequiredstring | nullSafety warnings and instructions, or null.
ProductSafetyContact
Who answers for a product's safety.
namerequiredstringThe company's name.
addressrequiredstring | nullThe postal address, or null.
emailrequiredstring | nullThe contact address, or null.
ProductTab
A product page tab. A built-in one, the merchant's text, or a table.
idrequiredstringThe tab's id.
kindrequired'builtin'A built-in tab shows content the product already holds.
labelrequiredstringThe merchant's name for it in the page language, or the default name of that content.
ProductTabBuiltin
A built-in tab's content: what the product already holds.
type ProductTabBuiltin = 'description' | 'specs' | 'guides' | 'warranty'ProductTable
A product table. A size chart, nutrition facts or specifications.
idrequiredstringThe table's id.
namerequiredstringThe table's name in the page language, such as "Women's tops".
labelrequiredstringThe text of its link, its tab title or its section heading; the name when the merchant wrote none.
placementsrequiredreadonly ProductTablePlacement[]Where it shows.
introrequiredstring | nullThe sentence above the table, or null.
guideTextrequiredstring | nullThe measuring instructions below the table, as Markdown, or null.
guideImageUrlrequiredstring | nullThe picture beside the measuring instructions, or null.
columnsrequiredreadonly ProductTableColumn[]The columns, the first one naming each row.
rowsrequiredreadonly ProductTableRow[]The rows, in the merchant's order.
selectVariantrequiredbooleanWhether a row whose first cell names a value of a product option selects that value.
unitSwitchrequiredbooleanWhether the shopper may flip the table between metric and imperial units.
ProductTableColumn
One column of a product table, such as a measurement.
idrequiredstringThe column's id; the key of its cell in each row.
labelrequiredstringThe column's heading in the page language.
typerequiredProductTableColumnTypeWhether its cells are text, one number or a range of numbers.
unitrequiredstring | nullThe unit its numbers are written in, such as `cm`, or null.
ProductTableColumnType
How a column's cells read.
type ProductTableColumnType = 'text' | 'number' | 'range'ProductTablePlacement
Where a table shows.
type ProductTablePlacement = 'link' | 'tab' | 'section'ProductTableRow
One row of a product table, such as a size.
idrequiredstringThe row's id.
cellsrequiredReadonly<Record<string, string>>The row's cell texts, by column id; a missing cell is empty.
ProductTabsDisplay
Tabs or an accordion. A tab bar, or one heading per tab.
type ProductTabsDisplay = 'tabs' | 'accordion'ProductWarranty
The warranty that comes with a product.
namerequiredstringThe warranty's name in the page language.
kindrequired'digitalLicense' | 'standard'Whether it covers a digital licence or a physical product.
activationWindowDaysrequirednumberDays the buyer has to activate the product.
supportWindowDaysrequirednumber | nullDays of support, or null when support has no end.
replacementWindowDaysrequirednumberDays within which a faulty item is replaced.
replacementAfterWindowGuaranteedrequiredbooleanWhether replacement is guaranteed after that window too.
RatingCount
How many reviews gave one star rating.
starsrequired1 | 2 | 3 | 4 | 5The star rating.
countrequirednumberHow many reviews gave it.
RatingStats
A product's review score.
averagerequirednumberThe average star rating, from 1 to 5.
countrequirednumberHow many reviews the average is over.
breakdownrequiredreadonly RatingCount[]How many reviews gave each star rating.