getTemplatesPreviewByMarker
Obtendo um objeto de template por marcador
TemplatePreviews.getTemplatesPreviewByMarker(marker, langCode)
const value = await TemplatePreviews.getTemplatePreviewByMarker('my-marker')
Esquema
marker:* string
Marcador do produto
exemplo: my-marker
langCode: string
Parâmetro opcional do código de idioma
exemplo: en_US
Este método recupera um único objeto de template com base em seu identificador textual (marcador) da API. Ele retorna uma Promise que resolve para um objeto TemplatePreviewsEntity.
Exemplo de retorno:
{
"id": 1,
"version": 0,
"identifier": "preview-templates",
"attributeValues": {
"marker": {
"value": "",
"type": "string",
"position": 1,
"isProductPreview": false,
"isIcon": false,
"attributeFields": {
"marker": {
"type": "string",
"value": "test"
}
}
}
},
"attributeSetIdentifier": "my-set",
"proportion": {
"vertical": {
"width": "2",
"height": "3",
"alignmentType": "leftTop",
"marker": "v"
},
"horizontal": {
"width": "234",
"height": "324",
"alignmentType": "middleBottom",
"marker": "h"
},
"square": {
"side": "3",
"alignmentType": "middleBottom",
"marker": "s"
}
},
"title": "Preview Templates",
"position": 1
}
Esquema
id: number
identificador do objeto
exemplo: 1764
version number
número da versão do objeto de modificação
exemplo: 10
identifier: string
identificador textual para um campo no registro
exemplo: catalog
proportion ITemplateProportionType
parâmetros de proporção do template
exemplo:
{
"horizontal": {
"height": 200,
"weight": 10,
"marker": "horizontal",
"title": "Horizontal",
"alignmentType": "left"
},
"vertical": {
"height": 10,
"weight": 200,
"marker": "vertical",
"title": "Vertical",
"alignmentType": "left"
},
"square": {
"marker": "square",
"title": "Square",
"slide": 3,
"alignmentType": "center"
}
}
title: string
nome do template
exemplo: template de página
positionId object
número da posição
exemplo: 0
positionId: number
identificador do objeto de posição
exemplo: 12