getProductBlockById
Get ContentPageBlock objects by product identifier
Products.getProductBlockById(id)
const value = await Products.getProductBlockById(1764)
Schema
id:* number
Product id
example: 1764
This method Getting a product block object by product id.
Example return:
[
{
"id": 3,
"attributeSetIdentifier": null,
"localizeInfos": {
"title": "Product block"
},
"version": 0,
"position": 1,
"identifier": "product_block",
"type": "forProductBlock",
"customSettings": {
"productConfig": {
"quantity": "1",
"countElementsPerRow": "1"
},
"similarProductRules": [],
"condition": {
"name": "cost",
"costTo": 130,
"costFrom": 0
},
"sliderDelay": null,
"sliderDelayType": null
},
"templateIdentifier": null,
"isVisible": true,
"isSync": false,
"attributeValues": {}
}
]
Schema
id: number
object identifier
example: 1764
attributeSetId: number
identifier for the used attribute set
example: 7
localizeInfos: CommonLocalizeInfos
block name with localization
example:
{
"en_US": {
"title": "My block"
}
}
customSettings: BlockCustomSettings
custom settings for different block types
example:
{
"sliderDelay": 0,
"sliderDelayType": "",
"productQuantity": 4,
"productSortType": "By_ID",
"productSortOrder": "Descending",
"productCountElementsPerRow": 10,
"similarProductRules": [
{
"property": "Descending",
"includes": "",
"keywords": "",
"strict": ""
}
]
}
version: number
object version number
example: 10
identifier: string
textual identifier for the field record
example: catalog
default: marker
position: number
position number (for sorting)
example: 192
attributeValues: Record<string, string>
array of attribute values from the index (presented as a pair of custom attribute identifier: attribute value)
example:
{
"en_US": {
"marker": {
"value": "",
"type": "string"
}
}
}
type: string
block type
example: forNewsPage
templateIdentifier: string
template marker used by the block (can be null)
Enum: [ forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, service ]
example: null