Skip to main content

getAttributesByMarker

Getting all attributes with data from the attribute set.

Description

This method return all attributes with data from the attribute set. It returns a Promise that resolves to an array of IAttributeSetsEntity objects.

AttributesSets.getAttributesByMarker(

marker*, langCode

);

Parameters schema

Schema

marker(required): string
Attribute marker
example: "productAttributes"

langCode: string
Language code. Default: "en_US"
example: "en_US"

Examples

Minimal example

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

Example with attributes

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

Example response

[
{
"type": "string",
"value": {},
"marker": "admin-text",
"position": 1,
"listTitles": [],
"validators": {},
"localizeInfos": {
"title": "Admins text"
},
"additionalFields": []
}
]

Response schema

Schema: IAttributeSetsEntity[]

id: number
The unique identifier of the attribute set entity.
example: 123

updatedDate: string
The date when the attribute set was last updated, represented as a string.
example: "2023-10-01T12:00:00Z"

version: number
The version number of the attribute set, used for tracking changes or updates.
example: 1

identifier: string
A string that uniquely identifies the attribute set.
example: "attributeSet1"

typeId: number
The numerical identifier representing the type of the attribute set.
example: 1

title: string
The title or name of the attribute set.
example: "Product Attributes"

schema: object
The schema definition associated with the attribute set. This could represent the structure or rules for the data.
example:

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

isVisible: boolean
Indicates whether the attribute set is visible or not.
example: true

properties: object
Additional properties associated with the attribute set, which can be of any type.
example:

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

type: string
The type of the attribute set, which could be a specific classification or category.
example: "product", "user", "etc"

position: number
The position number for sorting the attribute set.
example: 1