Nhảy đến nội dung

getAllTemplates

Lấy tất cả các đối tượng mẫu của một loại cụ thể.

Templates?.getAllTemplates( langCode? );

Ví dụ tối thiểu

const value = await Templates.getAllTemplates()
Schema

langCode: string
Mã ngôn ngữ. Mặc định: "en_US"
ví dụ: "en_US"

Phương thức này lấy tất cả các đối tượng mẫu được nhóm theo loại từ API. Nó trả về một Promise mà khi hoàn thành sẽ trả về một đối tượng GroupedTemplatesObject, chứa một mảng các đối tượng mẫu.

Ví dụ phản hồi

{
"catalog_page": [
{
"id": 4,
"attributeSetIdentifier": null,
"title": "Mẫu",
"generalTypeId": 4,
"identifier": "template",
"version": 0,
"generalTypeName": "catalog_page",
"attributeValues": {},
"position": 2
}
],
"product_preview": [
{
"id": 5,
"attributeSetIdentifier": null,
"title": "Xem trước sản phẩm",
"generalTypeId": 5,
"identifier": "product_preview",
"version": 0,
"generalTypeName": "product_preview",
"attributeValues": {},
"position": 1
}
],
"product_block": [
{
"id": 6,
"attributeSetIdentifier": null,
"title": "mẫu khối",
"generalTypeId": 10,
"identifier": "block-template",
"version": 0,
"generalTypeName": "product_block",
"attributeValues": {},
"position": 3
}
]
}
Schema