انتقل إلى المحتوى الرئيسي

getFrequentlyOrderedProducts

الحصول على المنتجات التي يتم طلبها بشكل متكرر حسب علامة الكتلة ومعرف المنتج.

الوصف

تُرجع هذه الطريقة المنتجات التي يتم طلبها بشكل متكرر المرتبطة بعلامة كتلة معينة ومعرف منتج. تُرجع وعدًا (Promise) يتم حله إلى كائن IProductsResponse.

Blocks.getFrequentlyOrderedProducts(

productId*, marker*, langCode, signPrice

);

مخطط المعلمات

المخطط

productId(required): number
معرف المنتج
مثال: 1

marker(required): string
علامة الكتلة
مثال: "frequently_ordered_block"

langCode: string
رمز اللغة. الافتراضي: "en_US"
مثال: "en_US"

signPrice: string
سعر العلامة

أمثلة

مثال بسيط

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

مثال مع السمات

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

مثال على الاستجابة

{
"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
}
}
}
]
}

مخطط الاستجابة

المخطط: IProductsEntity[]

total: number
إجمالي عدد المنتجات الموجودة.
مثال: 100

items: IProductsEntity[]
مصفوفة من كائنات المنتجات.
مثال:

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

items.id: number
المعرف الفريد.
مثال: 12345

items.localizeInfos: ILocalizeInfo
اسم المنتجات، مع الأخذ في الاعتبار التوطين.
مثال:

items.statusIdentifier: string | null
معرفات حالة صفحة المنتج (قد تكون null).
مثال: "in_stock"

items.statusLocalizeInfos: ILocalizeInfo
اسم الحالة المحلي للمنتج.
مثال: { "title": "Sale" }

items.attributeSetIdentifier: string | null
مجموعة معرفات السمات.
مثال: "set_12345"

items.position: number
رقم العنصر (لترتيب العناصر).
مثال: 1

items.price: number | null
قيمة سعر صفحة المنتج المأخوذة من الفهرس.
مثال: 150.00

items.additional: object
قيمة إضافية من الفهرس.
مثال: { prices: { min: 5 max: 150 } }

items.sku: string | null
SKU المنتج (وحدة حفظ المخزون)، قد تكون null.
مثال: "SKU_12345"

items.isSync: boolean
إشارة إلى فهرسة الصفحة.
مثال: true

items.attributeValues: AttributeType
مصفوفة من قيم السمات من الفهرس، ممثلة.
مثال:

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

items.categories: string[]
فئات المنتج.
مثال:

[
1,
2,
3
]

items.isVisible: boolean
علامة على رؤية الصفحة.
مثال: true

items.moduleFormConfigs: Array<IFormConfig>
تكوينات نموذج الوحدة (اختياري).

items.rating: IRating
بيانات التقييم.

items.isPositionLocked: boolean
مؤشر قفل موضع الترتيب (اختياري).
مثال: false

items.relatedIds: number[]
معرفات صفحات المنتجات ذات الصلة.
مثال:

[
12345,
67890
]

items.paymentStages: unknown
بيانات مراحل الدفع (قد تكون null).
مثال: null

items.discountConfig: Record<string, unknown>
كائن تكوين الخصم.
مثال:

items.templateIdentifier: string | null
معرف المستخدم للقالب المرتبط.
مثال: "template_12345"

items.shortDescTemplateIdentifier: string | null
معرف المستخدم للقالب المرتبط للوصف القصير.
مثال: "short_desc_template_12345"

items.signedPrice: string
علامة السعر.

items.productPages: IProductPageRef[]
مصفوفة من مراجع صفحات المنتجات تربط المنتج بصفحاته.
مثال:

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

productPages.id: number
المعرف الفريد لسجل ارتباط المنتج بالصفحة.
مثال: 16

productPages.pageId: number
معرف الصفحة التي يرتبط بها المنتج.
مثال: 4

productPages.productId: number
معرف المنتج.
مثال: 15

productPages.positionId: number
معرف موضع الترتيب داخل الصفحة.
مثال: 244

productPages.categoryPath: string
مسار الفئة للصفحة التي ينتمي إليها المنتج.
مثال: "products"

items.blocks: string[]
مصفوفة من معرفات الكتل.
مثال:

[
"block_12345",
"block_67890"
]