Variables
Template variables
These variables can be used only in the Templates.
Variable | Description |
---|---|
{{var label.title}} | Label text |
{{var label.description}} | Label description, can be used as value for title attribute |
{{var label.url}} | Label URL |
{{var label.image_url}} | Label's image URL |
{{var label.image}} | Label's image element with label image as background and with label text |
The {{var label.image}} variable represents a code snippet of the ready-to-use image block with label text. So the value of this variable is a HTML code that uses {{var label.title}} and {{var label.image_url}} inside it and has some predefined inline styles.
The raw value of this variable looks like here:
<div class="label-image" style="background:url({{var label.image}}); background-repeat: no-repeat; width: [image-width]; height: [image-height]; display: flex; justify-content: center; align-items: center; text-align: center">
<span class="label-title">{{var label.title}}</span>
</div>
Where [image-width] and [image-height] are automatically calculated width and height of the image. Those are not variables and can't be used in the HTML template field.
For further styling of the template that uses the {{var label.image}} variable, selectors like div.label-image
and span.label-title
can be used in the Styles field of the template edit form.
Label variables
These variables can be used only in the Labels.
Variable | Description |
---|---|
[br] | Adds a new line. |
[price] | Product price. |
[final_price] | Product final price. |
[sku] | Product SKU. |
[stock_qty] | Product's quantity in stock. |
[discount_amount] | Absolute discount (in store currency). |
[discount_percent] | Relative discount (in percent). |
[special_price_dl] | Days left for special price. |
[new_days] | Days since the product was added to the store or since the date Set product as new from. Returns an empty string if Set product as new to is past. |
[attr|code] | Value of the product's attribute. Replace code with the actual attribute code. Multiselect attributes return comma-separated values. |