Ana içeriğe geç

getProductBlockById

Ürün tanımlayıcısına göre ContentPageBlock nesnelerini al

Products.getProductBlockById(id)

const value = await Products.getProductBlockById(1764)
Şema

id:* sayı
Ürün id
örnek: 1764

Bu yöntem, ürün id'sine göre bir ürün blok nesnesi alır.

Örnek dönüş:

[
{
"id": 3,
"attributeSetIdentifier": null,
"localizeInfos": {
"title": "Ürün bloğu"
},
"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": {}
}
]
Şema

id: sayı
nesne tanımlayıcısı
örnek: 1764

attributeSetId: sayı
kullanılan özellik seti için tanımlayıcı
örnek: 7

localizeInfos: CommonLocalizeInfos
yerelleştirilmiş blok adı
örnek:

{
"en_US": {
"title": "My block"
}
}

customSettings: BlockCustomSettings
farklı blok türleri için özel ayarlar
örnek:

{
"sliderDelay": 0,
"sliderDelayType": "",
"productQuantity": 4,
"productSortType": "By_ID",
"productSortOrder": "Descending",
"productCountElementsPerRow": 10,
"similarProductRules": [
{
"property": "Descending",
"includes": "",
"keywords": "",
"strict": ""
}
]
}

version: sayı
nesne sürüm numarası
örnek: 10

identifier: dize
alan kaydı için metinsel tanımlayıcı
örnek: katalog
varsayılan: işaretçi

position: sayı
sıralama için pozisyon numarası
örnek: 192

attributeValues: Record<string, string>
indeksten gelen özellik değerleri dizisi (özel özellik tanımlayıcısı: özellik değeri çifti olarak sunulur)
örnek:

{
"en_US": {
"marker": {
"value": "",
"type": "string"
}
}
}

type: dize
blok türü
örnek: forNewsPage

templateIdentifier: dize
blok tarafından kullanılan şablon işaretçisi (null olabilir)
Enum: [ forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, service ]
örnek: null