ProductView
ProductView
|
|
Note
This component was introduced in version |
The ProductView controller provides an interface for triggering an analytics event for a product view.
Methods
view
Trigger a view event for the product.
Parameters
-
product:
ProductThe product view event payload.
Initialize
buildProductView
Creates an ProductView controller instance.
Parameters
-
engine:
CommerceEngineThe headless commerce engine.
Returns ProductView
Related types
HighlightKeyword
Properties
-
length:
numberThe length of the offset.
-
offset:
numberThe 0 based offset inside the string where the highlight should start.
Product
Properties
-
position:
numberThe 1-based product’s position across the non-paginated result set.
For example, if the product is the third one on the second page, and there are 10 products per page, its position is 13 (not 3).
-
additionalFields:
Record<string, unknown>The requested additional fields for the product.
-
children:
Omit<BaseProduct, 'children' | 'totalNumberOfChildren'>The child products of the product, fetched through product grouping.
-
clickUri:
stringThe URL of the product.
-
ec_brand:
string | nullThe brand of the product.
From the
ec_brandfield. -
ec_category:
string[]The category of the product (for example,
"Electronics;Electronics|Televisions;Electronics|Televisions|4K Televisions").From the
ec_categoryfield. -
ec_color:
string | nullThe color of the product.
-
ec_description:
string | nullThe description of the product.
From the
ec_descriptionfield. -
ec_gender:
string | nullThe gender the product is intended for.
-
ec_images:
string[]The URLs of additional product images.
From the
ec_imagesfield. -
ec_in_stock:
boolean | nullWhether the product is currently in stock.
From the
ec_in_stockfield. -
ec_item_group_id:
string | nullThe ID used for the purpose of product grouping.
From the
ec_item_group_idfield. -
ec_listing:
string | nullThe listing that the product belongs to.
-
ec_name:
string | nullThe name of the product.
From the
ec_namefield. -
ec_price:
number | nullThe base price of the product.
From the
ec_pricefield. -
ec_product_id:
string | nullThe product ID.
-
ec_promo_price:
number | nullThe promotional price of the product.
From the
ec_promo_pricefield. -
ec_rating:
number | nullThe product rating, from 0 to 10.
From the
ec_ratingfield. -
ec_shortdesc:
string | nullA short description of the product.
From the
ec_shortdescfield. -
ec_thumbnails:
string[]The URLs of the product image thumbnails.
From the
ec_thumbnailsfield. -
permanentid:
stringThe SKU of the product.
-
totalNumberOfChildren:
number | nullThe total number of child products fetched through product grouping.
-
excerpt?:
string | nullThe contextual excerpt generated for the product.
-
excerptsHighlights?:
HighlightKeyword[]The length and offset of each word to highlight in the product excerpt string.
-
nameHighlights?:
HighlightKeyword[]The length and offset of each word to highlight in the product name.