Ana içeriğe geç

getFrequentlyOrderedProducts

Blok işaretine ve ürün kimliğine göre sıkça sipariş edilen ürünleri alma.

Açıklama

Bu yöntem, belirli bir blok işareti ve ürün kimliği ile ilişkili sıkça sipariş edilen ürünleri döndürür. Bir Promise döndürür ve bu Promise, IProductsEntity nesnelerinin bir dizisi ile çözülür.

Blocks.getFrequentlyOrderedProducts(

productId*, marker*, langCode, signPrice

);

Parametreler şeması

Şema

productId(zorunlu): number
Ürün kimliği
örnek: 1

marker(zorunlu): string
Blok işareti
örnek: "frequently_ordered_block"

langCode: string
Dil kodu. Varsayılan: "en_US"
örnek: "en_US"

signPrice: string
Fiyat işareti

Örnekler

Minimal örnek

const response = await Blocks.getFrequentlyOrderedProducts(1, 'my-block');

Özelliklerle örnek

const response = await Blocks.getFrequentlyOrderedProducts(1, 'my-block', 'en_US');

Örnek yanıt

{
"total": 15,
"items": [
{
"localizeInfos": {
"title": "Товар"
},
"paymentStages": [
{
"title": "Part A",
"marker": "part_a",
"value": 100
},
{
"title": "Part B",
"marker": "part_b",
"value": 200
}
],
"id": 1764,
"isVisible": true,
"isSync": true,
"price": 0,
"additional": {
"prices": {
"min": 0,
"max": 100
}
},
"blocks": [],
"sku": "0-123",
"productPages": [
{
"id": 8997,
"pageId": 1176,
"productId": 8872
}
],
"rating": {
"votes": 42,
"value": 4.5,
"like": 10,
"dislike": 2,
"method": "weighted"
},
"statusLocalizeInfos": {
"title": "Товар"
},
"templateIdentifier": "my-template",
"shortDescTemplateIdentifier": "my-template-short",
"attributeValues": {
"marker": {
"value": "",
"type": "string",
"position": 1,
"isProductPreview": false,
"isIcon": false,
"additionalFields": {
"marker": {
"type": "string",
"value": "test"
}
}
}
},
"attributeSetIdentifier": "my-set",
"statusIdentifier": "my-status",
"position": 1,
"signedPrice": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"formModuleConfigs": [
{
"id": 1,
"formIdentifier": "reg",
"moduleIdentifier": "user",
"entityIdentifiers": [],
"isGlobal": true,
"isClosed": false,
"viewOnlyMyData": false,
"commentOnlyMyData": false,
"formDataCount": 0,
"entityFormDataCount": {},
"exceptionIds": [
"shop"
],
"nestedEntityIdentifiers": [
"avto-aksessuary",
"fm-moduliatory",
"avtomobilnye-derzhateli",
"videoregistratory-radiolokatory"
],
"ratingCalculation": "average",
"allowHalfRatings": true,
"maxRatingScale": 5,
"isAnonymous": true,
"allowRerating": true,
"isRating": true
}
],
"discountConfig": {
"discounts": [
{
"id": 5,
"identifier": "summer-sale",
"type": "DISCOUNT",
"localizeInfos": {
"title": "Summer Sale"
},
"startDate": "2026-01-01T06:32:19.736Z",
"endDate": "2026-01-28T06:32:22.632Z",
"discountValue": {
"value": 30,
"maxAmount": 0,
"discountType": "FIXED_PRICE",
"applicability": "TO_PRODUCT"
},
"exclusions": [
{
"id": 2
}
],
"position": 3,
"conditionLogic": "OR",
"gifts": [
{
"id": 3,
"localizeInfos": {
"title": "hhh222"
},
"attributeSetIdentifier": "attr-set-1",
"statusIdentifier": null,
"statusLocalizeInfos": {},
"templateIdentifier": null,
"price": 90,
"sku": null,
"attributeValues": {
"price1": {
"type": "integer",
"value": "90",
"isIcon": false,
"position": 0,
"additionalFields": [],
"isProductPreview": false
}
},
"isVisible": true
}
],
"conditions": [
{
"conditionType": "PRODUCT",
"entityIds": [
{
"id": 4,
"isNested": false
},
{
"isNested": false
}
],
"value": null
},
{
"conditionType": "ATTRIBUTE",
"entityIds": [
{
"isNested": false
}
],
"value": {
"value": "100",
"condition": "eq"
}
}
]
}
],
"discountPrice": 90,
"settings": {
"allowStacking": true,
"maxDiscountValue": 30,
"allowGiftStacking": false
}
}
},
{
"localizeInfos": {
"title": "Товар"
},
"paymentStages": [
{
"title": "Part A",
"marker": "part_a",
"value": 100
},
{
"title": "Part B",
"marker": "part_b",
"value": 200
}
],
"id": 1764,
"isVisible": true,
"isSync": true,
"price": 0,
"additional": {
"prices": {
"min": 0,
"max": 100
}
},
"blocks": [],
"sku": "0-123",
"productPages": [
{
"id": 8997,
"pageId": 1176,
"productId": 8872
}
],
"rating": {
"votes": 42,
"value": 4.5,
"like": 10,
"dislike": 2,
"method": "weighted"
},
"statusLocalizeInfos": {
"title": "Товар"
},
"templateIdentifier": "my-template",
"shortDescTemplateIdentifier": "my-template-short",
"attributeValues": {
"marker": {
"value": "",
"type": "string",
"position": 1,
"isProductPreview": false,
"isIcon": false,
"additionalFields": {
"marker": {
"type": "string",
"value": "test"
}
}
}
},
"attributeSetIdentifier": "my-set",
"statusIdentifier": "my-status",
"position": 1,
"signedPrice": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"formModuleConfigs": [
{
"id": 1,
"formIdentifier": "reg",
"moduleIdentifier": "user",
"entityIdentifiers": [],
"isGlobal": true,
"isClosed": false,
"viewOnlyMyData": false,
"commentOnlyMyData": false,
"formDataCount": 0,
"entityFormDataCount": {},
"exceptionIds": [
"shop"
],
"nestedEntityIdentifiers": [
"avto-aksessuary",
"fm-moduliatory",
"avtomobilnye-derzhateli",
"videoregistratory-radiolokatory"
],
"ratingCalculation": "average",
"allowHalfRatings": true,
"maxRatingScale": 5,
"isAnonymous": true,
"allowRerating": true,
"isRating": true
}
],
"discountConfig": {
"discounts": [
{
"id": 5,
"identifier": "summer-sale",
"type": "DISCOUNT",
"localizeInfos": {
"title": "Summer Sale"
},
"startDate": "2026-01-01T06:32:19.736Z",
"endDate": "2026-01-28T06:32:22.632Z",
"discountValue": {
"value": 30,
"maxAmount": 0,
"discountType": "FIXED_PRICE",
"applicability": "TO_PRODUCT"
},
"exclusions": [
{
"id": 2
}
],
"position": 3,
"conditionLogic": "OR",
"gifts": [
{
"id": 3,
"localizeInfos": {
"title": "hhh222"
},
"attributeSetIdentifier": "attr-set-1",
"statusIdentifier": null,
"statusLocalizeInfos": {},
"templateIdentifier": null,
"price": 90,
"sku": null,
"attributeValues": {
"price1": {
"type": "integer",
"value": "90",
"isIcon": false,
"position": 0,
"additionalFields": [],
"isProductPreview": false
}
},
"isVisible": true
}
],
"conditions": [
{
"conditionType": "PRODUCT",
"entityIds": [
{
"id": 4,
"isNested": false
},
{
"isNested": false
}
],
"value": null
},
{
"conditionType": "ATTRIBUTE",
"entityIds": [
{
"isNested": false
}
],
"value": {
"value": "100",
"condition": "eq"
}
}
]
}
],
"discountPrice": 90,
"settings": {
"allowStacking": true,
"maxDiscountValue": 30,
"allowGiftStacking": false
}
}
}
]
}

Yanıt şeması

Şema: IProductsEntity[]

total: number
Bulunan toplam ürün sayısı.
örnek: 100

items: IProductsEntity[]
Ürün varlıklarının bir dizisi.
örnek:

[
{
"id": 12345,
"title": "Product 1"
},
{
"id": 67890,
"title": "Product 2"
}
]

items.id: number
Benzersiz tanımlayıcı.
örnek: 12345

items.localizeInfos: ILocalizeInfo
Ürünlerin isimleri, yerelleştirme dikkate alınarak.
örnek:

items.statusIdentifier: string | null
Ürün sayfası durum tanımlayıcıları (null olabilir).
örnek: "in_stock"

items.statusLocalizeInfos: ILocalizeInfo
Ürün için yerelleştirilmiş durum adı.
örnek: { "title": "İndirim" }

items.attributeSetIdentifier: string | null
Özellikler seti kimliği.
örnek: "set_12345"

items.position: number
Sıralama için öğe numarası.
örnek: 1

items.price: number | null
İndeksten alınan ürün sayfası fiyatının değeri.
örnek: 150.00

items.additional: object
İndeksten alınan ek değer.
örnek: { prices: { min: 5 max: 150 } }

items.sku: string | null
Ürün SKU'su (Stok Tutma Birimi), null olabilir.
örnek: "SKU_12345"

items.isSync: boolean
Sayfa indeksleme durumu.
örnek: true

items.attributeValues: AttributeType
İndeksten temsil edilen özellik değerleri dizisi.
örnek:

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

items.categories: string[]
Ürün kategorileri.
örnek:

[
1,
2,
3
]

items.isVisible: boolean
Sayfa görünürlüğü durumu.
örnek: true

items.moduleFormConfigs: Array<IFormConfig>
Modül form yapılandırmaları (isteğe bağlı).

items.rating: IRating
Değerlendirme verisi.

items.isPositionLocked: boolean
Sıralama pozisyonu kilit durumu göstergesi (isteğe bağlı).
örnek: false

items.relatedIds: number[]
İlgili ürün sayfalarının kimlikleri.
örnek:

[
12345,
67890
]

items.paymentStages: unknown
Ödeme aşamaları verisi (null olabilir).
örnek: null

items.discountConfig: Record<string, unknown>
İndirim yapılandırma nesnesi.
örnek:

items.templateIdentifier: string | null
Bağlı şablonun kullanıcı kimliği.
örnek: "template_12345"

items.shortDescTemplateIdentifier: string | null
Kısa açıklama için bağlı şablonun kullanıcı kimliği.
örnek: "short_desc_template_12345"

items.signedPrice: string
Fiyat işareti.

items.productPages: IProductPageRef[]
Ürünü sayfalarına bağlayan ürün sayfası referanslarının dizisi.
örnek:

[
{
"id": 16,
"pageId": 4,
"productId": 15,
"positionId": 244,
"categoryPath": "products"
}
]

productPages.id: number
Ürün-sayfa bağlantı kaydının benzersiz tanımlayıcısı.
örnek: 16

productPages.pageId: number
Ürünün bağlı olduğu sayfanın tanımlayıcısı.
örnek: 4

productPages.productId: number
Ürün tanımlayıcısı.
örnek: 15

productPages.positionId: number
Sayfa içindeki sıralama pozisyonu tanımlayıcısı.
örnek: 244

productPages.categoryPath: string
Ürünün ait olduğu sayfanın kategori yolu.
örnek: "products"

items.blocks: string[]
Blok tanımlayıcılarının dizisi.
örnek:

[
"block_12345",
"block_67890"
]