Create or update a POS label template
On this page
In StoreConnect, label templates are created using ZPL (Zebra Programming Language) or EPL (Eltron Programming Language), combined with Liquid to inject dynamic product data. ZPL is supported by Zebra printers; EPL is used by older Eltron and Datamax hardware.
You will need to be able to write ZPL or EPL and use Liquid to create dynamic templates. You will also need Salesforce Admin access to add and update templates.
:::tip You don’t need to write ZPL from scratch. Free online ZPL preview tools let you design and test labels in the browser before adding them to StoreConnect. AI tools are also well-suited to generating ZPL for common label layouts: describe your label and ask it to produce the commands. Once you have working ZPL, wrap it in Liquid to inject product data. :::
Add or update a label template
- Open the StoreConnect Console.
- Go to POS Configuration and select POS Printer Templates.
- Select New or open an existing template.
- Give the template a descriptive Name, for example “Barcode label 40×30”.
- In the Context field, select label.
- In the Printer Type field, select Label.
- Enter your label code in the Content field. A sample is provided below.
- Select Save.
- Test the output and adjust until you are happy with the results.
The template is available to select as the label template in the POS under Settings > Hardware, and prints when staff trigger a label print action.
Sample template
This sample is designed for a 40mm wide × 30mm high label (320 × 240 dots at 8 dots per mm). Adjust ^PW and ^LL values if your label size differs.
The inner loop prints quantity labels for each product. Without it, the template prints one label per product, whatever quantity is requested.
```liquid
{% for product in products %} {% for i in (1..quantity) %} ^XA ^PW320 ^LL240
^FX Product code ^CFA,15 ^FO0,15^FB320,1,,C,^FD{{ product.product_code }}^FS
^FX Product name - centered, max 2 lines ^CF0,22 ^FO0,38^FB320,2,10,C,^FD{{ product.name }}^FS
^FX Code 128 barcode ^FO37,85^BY2,,50^BCN,50,Y,N,N^FD{{ product.barcode }}^FS
^FX Print date ^CF0,22 ^FO15,192^FB150,1,,L,^FD{{ ‘now’ | date: “%m/%d/%Y” }}^FS
^FX Price ^CF0,32 ^FO15,180^FB290,1,,R,^FD{{ product.pricing.price | money }}^FS
^XZ {% endfor %} {% endfor %} ```
Explanation of sample template
```liquid
{% for product in products %} // Loop over selected products {% for i in (1..quantity) %} // Repeat the label once for each label staff asked for
^XA // Start of label format ^PW320 // Label width in dots (320 dots = 40mm at 8 dots/mm) ^LL240 // Label height in dots (240 dots = 30mm at 8 dots/mm)
^FX Product code ^CFA,15 // Font A, height 15 ^FO0,15^FB320,1,,C,^FD{{ product.product_code }}^FS // Full width, centered
^FX Product name - centered, max 2 lines ^CF0,22 // Font 0, size 22 ^FO0,38^FB320,2,10,C,^FD{{ product.name }}^FS // Up to 2 lines, centered
^FX Code 128 barcode ^FO37,85^BY2,,50^BCN,50,Y,N,N^FD{{ product.barcode }}^FS // ^BCN is Code 128
^FX Print date ^CF0,22 // Font 0, size 22 ^FO15,192^FB150,1,,L,^FD{{ ‘now’ | date: “%m/%d/%Y” }}^FS // Left aligned, MM/DD/YYYY // Use “%d/%m/%Y” for DD/MM/YYYY. The date filter is not // locale-aware, so choose the format that suits your region
^FX Price ^CF0,32 // Font 0, size 32 ^FO15,180^FB290,1,,R,^FD{{ product.pricing.price | money }}^FS // Align right
^XZ // End of label format
{% endfor %} // End of quantity loop {% endfor %} // End of product loop ```
Available variables
Label templates receive a products array and a quantity value. Loop over products for each product, and over (1..quantity) inside it for the number of labels.
| Variable | Description |
|---|---|
products |
Array of products to print labels for |
quantity |
Labels to print per product, from the Labels screen or a print:labels action (default: 1). Takes effect only if the template loops over it |
Key properties available on each item in the products array:
| Property | Description |
|---|---|
product.name |
Product name |
product.product_code |
Product code / SKU |
product.barcode |
Barcode value |
product.pricing.price |
Product price (use with the money filter) |
product.sfid |
Salesforce record ID |
Was this article helpful?
Thanks for your feedback! It helps us improve our docs.