Lewati ke konten utama

getAttributeSetByMarker

Mengambil satu objek dari atribut yang ditetapkan berdasarkan penanda.

Deskripsi

Metode ini mengembalikan satu atribut dengan data dari set atribut. Ini mengembalikan sebuah Promise yang menyelesaikan menjadi objek IAttributeSetsEntity.

AttributesSets.getAttributeSetByMarker(

marker*, langCode

);

Skema parameter

Skema

marker(diperlukan): string
penanda dari objek set atribut
contoh: "productAttributes"

langCode: string
Kode bahasa. Default: "en_US"
contoh: "en_US"

Contoh

Contoh minimal

const response = await AttributesSets.getAttributeSetByMarker('my-marker');

Contoh dengan atribut

const response = await AttributesSets.getAttributeSetByMarker('my-marker', 'en_US');

Contoh respons

{
"id": 27,
"createdDate": "2025-10-28T13:50:27.426Z",
"updatedDate": "2025-02-26T17:18:11.275Z",
"version": 0,
"identifier": "admins",
"typeId": 1,
"title": "Admins",
"schema": {
"admin-text": {
"id": 1,
"type": "string",
"original": true,
"isVisible": true,
"identifier": "admin-text",
"initialValue": null,
"localizeInfos": {
"title": "Admins text"
}
}
},
"isVisible": true,
"properties": {},
"type": {
"id": 1,
"type": "forAdmins"
},
"position": 1
}

Skema respons

Skema: IAttributeSetsEntity

id: number
Pengidentifikasi unik dari entitas set atribut.
contoh: 123

createdDate: string
Tanggal ketika set atribut dibuat.
contoh: "2023-10-01T12:00:00Z"

updatedDate: string
Tanggal ketika set atribut terakhir diperbarui.
contoh: "2023-10-01T12:00:00Z"

version: number
Nomor versi dari set atribut, digunakan untuk melacak perubahan atau pembaruan.
contoh: 1

identifier: string
Sebuah string yang secara unik mengidentifikasi set atribut.
contoh: "attributeSet1"

typeId: number
Pengidentifikasi numerik yang mewakili jenis set atribut.
contoh: 1

title: string
Judul atau nama dari set atribut.
contoh: "Atribut Produk"

schema: Record<string, IAttributeSchemaItem>
Bidang skema yang dikunci berdasarkan penanda.
contoh:

{
"attribute1": {
"id": 1,
"type": "string",
"isPrice": false,
"original": true,
"identifier": "string",
"localizeInfos": {
"en_US": {
"title": "String"
}
}
}
}

isVisible: boolean
Menunjukkan apakah set atribut terlihat atau tidak.
contoh: true

properties: Record<string, unknown>
Properti tambahan yang terkait dengan set atribut; objek kosong jika tidak ada.
contoh:

{
"color": "red",
"size": "M"
}

type: string
Jenis dari set atribut, yang bisa berupa klasifikasi atau kategori tertentu.
contoh: "produk", "pengguna", "dll"

position: number
Nomor posisi untuk mengurutkan set atribut.
contoh: 1