Aller au contenu principal

getAttributesByMarker

Récupération de tous les attributs avec des données de l'ensemble d'attributs.

Cette méthode renvoie tous les attributs avec des données de l'ensemble d'attributs.

AttributesSets.getAttributesByMarker( marker, langCode );

Exemple minimal

const value = await AttributesSets.getAttributesByMarker('my-marker');

Exemple avec des attributs

const value = await AttributesSets.getAttributesByMarker('my-marker', 'en_US');

Schéma des paramètres

Schéma

marker(required): string
Marqueur d'attribut
exemple : "productAttributes"

langCode: string
Code de langue. Par défaut : "en_US"
exemple : "en_US"

Exemple de réponse

{
"id": 27,
"updatedDate": "2025-02-26T17:18:11.275Z",
"version": 0,
"identifier": "admins",
"typeId": 1,
"title": "Admins",
"schema": {
"admin-text": {
"id": 1,
"type": "string",
"isPrice": false,
"original": true,
"isVisible": true,
"identifier": "admin-text",
"localizeInfos": {
"title": "Texte des Admins"
}
}
},
"isVisible": true,
"type": {
"id": 1,
"type": "forAdmins"
},
"position": 1
}

Schéma de réponse

Schéma: IAttributeSetsEntity[]

id: number
L'identifiant unique de l'entité de l'ensemble d'attributs.
exemple : 123

updatedDate: string
La date à laquelle l'ensemble d'attributs a été mis à jour pour la dernière fois, représentée sous forme de chaîne.
exemple : "2023-10-01T12:00:00Z"

version: number
Le numéro de version de l'ensemble d'attributs, utilisé pour suivre les modifications ou mises à jour.
exemple : 1

identifier: string
Une chaîne qui identifie de manière unique l'ensemble d'attributs.
exemple : "attributeSet1"

typeId: number
L'identifiant numérique représentant le type de l'ensemble d'attributs.
exemple : 1

title: string
Le titre ou le nom de l'ensemble d'attributs.
exemple : "Attributs de Produit"

schema: any
La définition du schéma associée à l'ensemble d'attributs. Cela pourrait représenter la structure ou les règles pour les données.
exemple :

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

isVisible: boolean
Indique si l'ensemble d'attributs est visible ou non.
exemple : true

properties: any
Propriétés supplémentaires associées à l'ensemble d'attributs, qui peuvent être de tout type.
exemple :

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

type: any
Le type de l'ensemble d'attributs, qui pourrait être une classification ou une catégorie spécifique.
exemple : "produit", "utilisateur", "etc"

position: number
Le numéro de position pour trier l'ensemble d'attributs.
exemple : 1