Skip to main content

getProductBlockById

Get ContentPageBlock objects by product identifier.

Products?.getProductBlockById( id? );

Minimal example

const value = await Products.getProductBlockById(1764)
Schema

id(required): number
Product id
example: 12345

This method Getting a product block object by product id.

Example response

[
{
"id": 1,
"attributeSetIdentifier": null,
"localizeInfos": {
"title": "Product Block"
},
"version": 0,
"position": 1,
"identifier": "product_block",
"type": "product_block",
"customSettings": {
"productConfig": {
"quantity": "1",
"sortType": 0,
"sortOrder": 0,
"countElementsPerRow": "1"
},
"similarProductRules": [],
"condition": {
"name": "cost",
"costTo": 130,
"costFrom": 0
},
"sliderDelay": null,
"sliderDelayType": null
},
"templateIdentifier": null,
"isVisible": true,
"isSync": false,
"attributeValues": {}
}
]
Schema

id: number
Unique identifier of the product block.
example: 3289

attributeSetIdentifier: number | null
Identifier of the attribute set used in the product block, or null if not applicable.
example: 67890

localizeInfos: ILocalizeInfo
Localization information for the product block.
example:

{
"title": "Box"
}

version: number
Version of the product block entity.
example: 1

position: number
Position of the product block in a list or layout.
example: 1

identifier: string
Unique string identifier for the product block.
example: "product_block_12345"

type: Types
Type of the product block, such as "product", "error_page", etc.
example:

"product"

customSettings: object
Custom settings for the product block, including slider delay, product configuration, similar product rules, and conditions.
example:

{}

templateIdentifier: string | null
Identifier for the template used by the product block, or null if not applicable.
example: "template_12345"

isVisible: boolean
Indicates whether the product block is visible.
example: true

isSync: boolean
Indicates whether the product block is synchronized.
example: false

attributeValues: AttributeType
Array of attribute values from the index, represented as a pair of user attribute id and attribute value.
example:

[
{
"id": "color",
"value": "red"
}
]