Hi. How can we help?

Customizing print templates

Retail POS includes print templates with standard information needed when printing different types of customer-facing material like:

  • sales receipts
  • labels
  • purchase orders
  • transfers
  • work orders
  • vendor returns

With custom print templates, you can customize receipt, label, and order templates to suit your business needs.

Sales receipts, work orders, and purchase orders also have templates available in French, Dutch, German, and Spanish. For countries that require it, you can use custom print templates for Cash rounding on sales receipts.

Enabling the print templates feature

Before accessing and customizing templates, the Print Templates feature must be added to your account.

  1. Navigate to Settings > Print Templates.

    Retail-R-customizing-templates-settings-page.png

  2. If you don't see the Print Templates section, contact our Retail Support team for access.

Accessing print templates

You can access custom templates in the print template repository.

To customize and print labels faster and easier, use the Label editor with Lightspeed Hub.

Customizing print templates

  1. Use the links above or navigate to the print template repository and click the folder of the type of template you'd like to customize. 

    Retail-R-customizing-print-templates-github-templates.png

  2. Click into the template (.tpl). Supported language versions are also available.
  3. Click into the code box or click Raw to open the raw code window, then select all (Cmd + A) and copy the raw code (Cmd + C).

    Retail-R-customizing-print-templates-copy-code.png

  4. In Retail POS on the Print templates page, paste the raw code into the associated print template field.

    printtemplates_salesreceipts.gif

  5. If the print template field is not listed, click the appropriate button at the top of the page:
    • + New SaleReceipt
    • + New ItemLabel
    • + New WorkorderReceipt
    • + New PurchaseOrderReceipt
    • + New TransferReceipt
  6. Customize the print template as desired. At the top of the custom print template code, options are listed on the right side and can be changed to true or false depending on your needs.

    Retail-R-customizing-templates-true-false.png

  7. Click anywhere outside the print template field to save your changes.

Updating custom print templates to display item fees

SaleReceipt or WorkorderReceipt custom print templates must be updated before setting up item fees or you will get an error message when trying to use the feature. Item fees can only be added after the template updates have been implemented.

To update your custom print template to display item fees, you can either use the latest template version or manually add specific lines of code to your current template.

Using the latest template version

To use the latest print template designed for compatibility with item fees:

  1. In Retail POS, navigate to Settings > Print templates.
  2. Backup your current template in a separate document or use the Custom Template Option to save the template using a different name. This will ensure you can quickly revert your changes, if needed.
  3. In the print template repository, click the receipt or workorder folder.

    Retail-R-customizing-print-templates-github-folders.png

  4. Click into the template (.tpl). Supported language versions are also available.
  5. Click into the code box or click Raw to open the raw code window, then select all (Cmd + A) and copy the raw code (Cmd + C).
  6. In Retail POS on the Print templates page, paste the raw code into the appropriate print template field.

    Retail-R-customizing-templates-templates-page.png

  7. If your current receipt or work order template includes custom options or modifications, re-add these to the template.
  8. Click anywhere outside the print template field to save your changes.

Manually updating your existing template

Alternatively, you can manually add specific lines of code to make your current template compatible with item fees. Select the Sales receipts or Work orders tab below to get started.

  • Updating your sales receipt template

    1. To stylistically accommodate item fees, add the following code to your template:

      table div.line_description_item_fee {
      	padding-left: 10px;
      }
      
      .footerSectionTitle + table div.line_description_item_fee {
      	padding-left: 25px;
      }
      
    2. In the macro lineDescription of your template, add the following code so item fees can properly display below associated item descriptions:

           {% elseif Line.ItemFee and Line.itemFeeID and (Line.lineType == 'item_fee' or Line.lineType == 'item_fee_refund') %}
                <div class="line_description_item_fee">
                {{ Line.ItemFee.name|nl2br }}{% if Line.tax == 'false' or (Line.calcTax1 == 0 and Line.calcTax2 == 0) %}*{% endif %}
                </div>

      After adding, the code segment should look like this in your template:

      Retail-R-customizing-templates-receipt-macrolineDescription.png

    3. To display the total of all item fees at the end of the receipt, add the following code to the macro receipt section, directly below the tbody with ID receiptSaleTotals:

            {% if Sale.MetaData.itemFeesSubtotal %}
                <tr>
                  <td width="100%">Fee total</td>
                  <td id="receiptSaleItemFeesTotal" class="amount">{{Sale.MetaData.itemFeesSubtotal|money}}
                  </td>
                      </tr>
                {% endif %}

      After adding, the code segment should look like this in your template:

      Retail-R-customizing-templates-receipt-macroreceipt.png

  • Updating your work order template

    1. To stylistically accommodate item fees, add the following code to your template:

      table td.item_fee_line_name {
      	text-align: left;
      	padding-left: 10px;
      }
      }        
    2. Then, find the condition WorkorderItem.isSpecialOrder == 'false' and replace the code in between {% for WorkorderItem in Workorder.WorkorderItems.WorkorderItem %} and {% endfor %} in that section with this code:

      {% if WorkorderItem.itemFeeID == 0 %}
          {% if WorkorderItem.isSpecialOrder == 'false' %}
              {{ _self.line(WorkorderItem, parameters, _context) }}
          {% else %}
              {% set specialorder = true %}
          {% endif %}
      {% endif %}

      After adding, the code segment should look like this in your template:

      Retail-R-customizing-templates-workorder-WorkorderItem.png

    3. Just underneath in the same section, after {% for WorkorderLine in Workorder.WorkorderLines.WorkorderLine %} <!--this loop is necessary for showing labor charges -->, replace the expression {{ _self.line(WorkorderLine, parameters) }} with this code:

       {% if WorkorderLine.itemFeeID == 0 %}
          {{ _self.line(WorkorderLine, parameters) }}
       {% endif %}

      After adding, the code segment should look like this in your template:

      Retail-R-customizing-print-templates-item-fees-workorder-code.png

    4. In the macro line of your template, add the following code so item fees can properly display below associated item descriptions:

       {% for WorkorderSaleLine in Line.SaleLine %}
      {% if WorkorderSaleLine.itemFeeID != 0 and (WorkorderSaleLine.lineType == 'item_fee' or WorkorderSaleLine.lineType == 'item_fee_refund') %}
      <tr data-automation="lineItemRow">
      <td data-automation="lineItemRowItemFee" class="item_fee_line_name">
      <div>
      {% autoescape true %}{{ WorkorderSaleLine.ItemFee.name|nl2br }}{% endautoescape %}
      </div>
      </td>
      <td data-automation="lineItemFeeQuantity" class="quantity">{{ WorkorderSaleLine.unitQuantity }}</td>
      <td data-automation="lineItemFeeRowCharge" class="amount">{{ WorkorderSaleLine.ItemFee.feeValue|money }}</td>
      </tr>
      {% endif %}
      {% endfor %}

      After adding, the code segment should look like this in your template:

      Retail-R-customizing-templates-workorder-macroline.png

    5. To display the total of all item fees at the end of the receipt, add the following code after Workorder.MetaData.discount before the Tax <tr>:

         {% if Workorder.MetaData.itemFeesSubtotal %}
            <tr>
      	<td>Fee total</td>
      	<td id="totalsFeesValue" class="amount">
      	  {{Workorder.MetaData.itemFeesSubtotal|money}}
      	</td>
            </tr>
      	{% endif %}

      After adding, the code segment should look like this in your template:

      Retail-R-customizing-templates-workorder-itemFeesSubtotal.png

Printing test receipts

After making changes to custom print templates, it’s recommended to print a test receipt to verify everything is working as expected.

To test your customized print template:

  1. Navigate to Reports > Totals.
  2. To open a transaction, click its blue ID number.

    Retail-R-customizing-print-templates-totals-report-ID.png

  3. To print a sales receipt, click Print Receipt.

    printemplates_printtestreceipt.gif

To test print by location:

  1. Navigate to Settings > Locations.
  2. On the location you’d like to test, click Customize.
  3. Under Receipt Setup, click Print Preview.

    Retail-R-customizing-print-templates-locations-print-preview.png

What's next?

Printing receipts

Set up sales receipts and print or email them to customers.

Learn more

Printing labels

Learn more about labels and different ways to print them.

Learn more

Was this article helpful?

0 out of 0 found this helpful