How to Use Barcodes

IN THIS GUIDE

Overview
Adding QR Codes
Adding Barcodes
Barcode Types
Using Barcode Scanners
Sample Barcode Email Template

Overview

If you need a way to include barcodes in your email or receipt templates, you can do so with Order Desk and some Twig.

Adding QR Codes

To add a QR Code to a template using Twig, use this filter:

|qrcode

or:

|qrcode(300)

for a larger size. The default size is 150.

Example:

<img src="{{ order.source_id|qrcode }}">

Adding Barcodes

To add a barcode, use this Twig filter:

|barcode

or:

|barcode(type, width, height)

Replace (type, width, height) with the values needed. The default values are ("C128", 2, 80).

Example:

<img src="{{ order.source_id|barcode("C39", 2, 80) }}">

Barcode Types

Available barcode options are

C39 
C39+ 
C39E 
C39E+ 
C93 
S25 
S25+ 
I25 
I25+ 
C128 
C128A 
C128B 
C128C 
EAN2 
EAN5 
EAN8 
EAN13 
UPCA 
UPCE 
MSI 
MSI+ 
POSTNET 
PLANET 
RMS4CC 
KIX 
IMB 
CODABAR 
CODE11 
PHARMA 
PHARMA2T

Using Barcode Scanners

Order Desk can listen for your USB scanner input. Depending on how your barcodes are set up, you can do one of three things with a scanner.

Enable this functionality by adding USBSCANNER to the custom special settings on your Store Settings page.

Access Order Detail Page

This works with regular QR codes or barcodes.

Example code to pull up the order number:

<img src="{{ ("^#^" ~ order.id)|barcode("C128", 1, 40) }}">

Move Order to Different Folder

This works with regular QR codes or barcodes.

Example code for moving an order to folder 300:

<img src="{{ ("^F300^" ~ order.id)|barcode("C128", 1, 40) }}">

Execute Button Action or Integration Submission

Works with QR codes only due to the length of the barcode strings being too long to be scanned.

Example code to submit the order to a button called Blue:

<img src="{{ ("^submit_to_blue_zvoxh9^" ~ order.id)|qrcode(100) }}">

To get the submission string, look in your browser's inspector tool. Find either the custom button or the integration submit button then update your code with that string.

Sample Barcode Email Template

The following code is an example of an email template you can use in Order Desk that would send the customer a receipt and create barcodes on the spot. The variable field names are slightly different from the receipt template itself. 

In this example a barcode is generated for every item on the order, and the barcode will read the item's unique ID.

If you don't see the code, please click the expand button above to open this article in a full-size window.

Still need help? Contact Us Contact Us