Barcode snippet generator

Add a barcode to a Shopify packing slip

Generate copy-paste Shopify Order Printer Liquid for order, SKU, variant barcode, tracking, and QR code placement.

Quick answer

Add a barcode to a Shopify packing slip for Shopify Order Printer

Choose the barcode source, copy the Liquid snippet, and use the placement notes before saving the template. Start in a duplicate Shopify Order Printer template, paste the Liquid in the right placement area, and preview with real orders before saving.

  1. Open Shopify admin, then go to Apps > Order Printer > Templates.
  2. Open the packing slip or invoice template you want to edit.
  3. Decide whether the barcode identifies the order, the product row, the variant barcode, or the shipment tracking value before copying code.

Copy-ready example

Starter Liquid pattern

Use this as a visible pattern, then use the generator below to adjust the exact field, fallback text, layout, and test notes.

{% assign opk_barcode_value = order.name %}
{% if opk_barcode_value != blank %}
  <s-barcode value="{{ opk_barcode_value }}" />
  <p>{{ opk_barcode_value }}</p>
{% endif %}

Barcode snippet generator

Add a barcode to a Shopify packing slip

Choose the barcode source, copy the Liquid snippet, and use the placement notes before saving the template.

Standard order with one clear product row.
Need an order barcode added to the header?

Send the current template and the order identifier workflow; the fix places the barcode where staff can scan it without crowding the page.

Add order barcode to my template

Paid feature signals

Generated Liquid

Copy-paste code

{% assign opk_barcode_value = order.name %}
{% if opk_barcode_value != blank %}
  <div class="opk-order-barcode">
    <s-barcode value="{{ opk_barcode_value }}" />
    <p>{{ opk_barcode_value }}</p>
  </div>
{% else %}
  <p class="opk-order-barcode opk-muted">Missing barcode value for this order.</p>
{% endif %}

Install wizard

Place the snippet before testing output.

1
Template area

Order header

2
Paste target

Paste near the order header or order details where staff scan the order identifier.

3
Test order

Scanner-ready order preview

Paste location

Paste near the order header or order details where staff scan the order identifier.

Test checklist

  • Duplicate the Shopify Order Printer template before editing the live one.
  • Preview with the regular order.
  • Scan the printed code with the same scanner or phone workflow staff will use.
  • Print or save one test preview before using the template in production.

Common failure

  • The barcode renders blank because the selected SKU, variant barcode, or tracking value is empty.
  • The snippet is pasted outside the line item loop, so line item fields are not available.
  • The merchant uses order_number when warehouse staff expect the visible order name, such as #1048.

Mock preview

#1048Standard order with one clear product row.
|||| || ||| |||| |||

#1048

Use case

When to use this tool

Best for merchants who need a scannable order number, SKU, variant barcode, or tracking number on a packing slip without installing a full PDF invoice app.

Uses Shopify Order Printer's supported s-barcode element for barcode and QR output.

Separates order-level codes from line-item codes so SKU and variant data stay inside the item loop.

Compares order.name, order.order_number, line_item.sku, line_item.variant.barcode, and fulfillment tracking values.

Keeps SKU barcode use cases separate from variant barcode use cases so blank variant data is easier to diagnose.

Includes line-item loop guidance for printing one barcode per product row.

Adds readable text below the code when warehouse staff need a human fallback.

Explains scanner-risk limits around module size, paper, thermal printer darkness, and empty Shopify fields.

Free tool fit

Use the snippet when the edit is narrow.

Choose the barcode source, copy the Liquid snippet, and use the placement notes before saving the template.

  • You know which Shopify Order Printer template you want to edit.
  • You can test in a duplicate template before touching the live one.
  • The field or layout change maps to the Liquid objects listed on this page.

Manual fix fit

Request help when placement is risky.

Paste your full template and get the right order, SKU, variant, or tracking barcode inserted with install steps.

  • Your current template already has custom loops, tables, CSS, or app-specific fields.
  • The snippet works in isolation but prints blank, repeats, or breaks layout in your real template.
  • The document is customer-facing, B2B, VAT, customs, or warehouse-critical and needs careful test notes.

Install steps

Copy into Shopify Order Printer carefully.

The preview uses sample data. Always test the template with real orders before using it for fulfillment, accounting, customs, or customer-facing documents.

  1. Step Open Shopify admin, then go to Apps > Order Printer > Templates.
  2. Step Open the packing slip or invoice template you want to edit.
  3. Step Decide whether the barcode identifies the order, the product row, the variant barcode, or the shipment tracking value before copying code.
  4. Step For order barcodes, paste the snippet near the document header or order details.
  5. Step For SKU or variant barcodes, paste the snippet inside the line item loop, usually inside the item table.
  6. Step If the selected value can be blank, keep readable text or fallback copy visible during the first test print.
  7. Step Preview with real orders that have the selected SKU, variant barcode, or tracking value before saving.
  8. Step Print one test page and scan it with the same warehouse scanner before using it for fulfillment.

Problem diagnosis

Match the symptom before changing Liquid.

Use these checks to decide whether the issue is field data, snippet placement, print settings, or a template merge problem.

The barcode area prints blank.

Likely cause
The selected field is empty on the test order, or a line item value such as SKU or variant barcode was pasted outside the item loop.
Fix
Test with an order that has the value filled in, then move SKU or variant barcode snippets inside the line item loop.

The barcode scans the wrong value.

Likely cause
The template uses order.order_number when staff expect order.name, or it encodes SKU when the warehouse scanner expects variant barcode.
Fix
Choose the source that matches the warehouse workflow: order name for #1048, SKU for pick bins, variant barcode for retail barcode scans.

Tracking barcodes do not appear.

Likely cause
The order has not been fulfilled yet, so Order Printer does not have a tracking number to print.
Fix
Preview a fulfilled order with tracking data, and keep tracking barcode blocks conditional so draft or unfulfilled orders stay clean.

The printed barcode is visible but not scannable.

Likely cause
The code is too small, too light, squeezed by a 4x6 layout, or printed with unexpected browser scaling.
Fix
Increase barcode width, print at actual size, darken thermal printer settings, and scan a real test print before saving the template.

FAQ

Common Shopify Order Printer issues

Can this print a product barcode for every line item?

Yes. Choose variant barcode and paste the generated line item block inside the loop that prints each product row.

Should I use SKU or variant barcode?

Use SKU when your warehouse scans SKU values. Use variant barcode when Shopify stores the retail barcode on the variant and scanners expect that value.

Should I choose order name or order number?

Use order name when staff scan or read the visible order value like #1048. Use order number only when your downstream system expects the numeric value.

Where do SKU and variant barcode snippets go?

They belong inside the line item loop, close to the item title, SKU, quantity, or pick-pack table row.

Why does my barcode show an empty value?

The selected field may be blank on that order or variant. Test with an order that has SKU, tracking, or variant barcode data filled in.

What should I do when some SKUs are blank?

Keep the line item title and readable fallback text visible, then either fill missing SKUs in Shopify or switch to variant barcode if that field is maintained.

Can I put tracking barcodes on a packing slip?

Only after the order has fulfillment tracking data. Unfulfilled orders usually do not have a tracking number available to Order Printer yet.

Can I print a QR code instead of a barcode?

Yes. Choose QR code in the generator. Test it with your scanning app because QR workflows vary more than basic barcode scans.

Does this guarantee a scanner will read the barcode?

No. Scanner support depends on printed size, paper, printer quality, and the value being encoded. Always test with your scanner.

Related exact fixes

Follow the next likely Order Printer problem.

These links connect adjacent search intents, such as blank metafields, item-level customs fields, B2B invoice data, and one-off template fixes.

Metafield Liquid generator

Add metafields to Shopify Order Printer

Best for merchants adding product specs, HS codes, country of origin, VAT notes, wholesale fields, or customer fields to printed documents.

Open related fix

4x6 packing slip starter

Shopify 4x6 packing slip template code

Best for warehouses and small stores that want a compact packing slip for thermal labels without moving to a full invoice app.

Open related fix

Commercial invoice fields

Shopify commercial invoice template fields

Place HS code, origin, customs description, and EORI notes in the right row.

Open related fix

Line item properties

print Shopify line item properties

Show gift options, personalization, and bundle details without private fields.

Open related fix

VAT invoice fields

Shopify VAT invoice template fields

Add VAT IDs, tax notes, and B2B invoice fields with cautious scope.

Open related fix

PO number invoice

add a PO number to Shopify invoices

Handle B2B purchase order data without repeating it inside item rows.

Open related fix

HS code Order Printer

add HS codes to Shopify Order Printer

Print item-level HS codes from product or variant metafields.

Open related fix

Country of origin invoice

add country of origin to Shopify invoices

Print origin beside customs description, quantity, and HS code.

Open related fix

Common Order Printer fixes

Keep editing the same Shopify template.

These are the highest-signal internal paths for merchants who need template code, packing slip layout, barcodes, metafields, or 4x6 print fixes.

Template code generator

free Shopify Order Printer template code generator

Start with a printable template before adding fields.

Open tool

Packing slip template code

Shopify packing slip template code

Build the base pick-pack document for warehouse use.

Open tool

Metafield Liquid generator

Shopify Order Printer metafields

Print product, variant, order, or customer metafields.

Open tool

4x6 packing slip starter

Shopify 4x6 packing slip template

Test thermal printer layout, margins, and item overflow.

Open tool

Line item properties

Shopify Order Printer line item properties

Show personalization, bundle details, and gift options.

Open tool

Liquid objects

Fields this page usually touches

  • order.name
  • order.order_number
  • line_item.sku
  • line_item.variant.barcode
  • fulfillment.tracking_number
  • order.fulfillments.first.tracking_number

Common errors

Watch these before saving

  • The barcode renders blank because the selected SKU, variant barcode, or tracking value is empty.
  • The snippet is pasted outside the line item loop, so line item fields are not available.
  • The merchant uses order_number when warehouse staff expect the visible order name, such as #1048.
  • A SKU is encoded even though the warehouse scanner expects the product's variant barcode value.
  • Tracking barcodes are tested on an unfulfilled order, so no tracking number exists yet.
  • The printed code is too small, too light, or too close to surrounding text for the warehouse scanner.

Limits

What this does not replace

  • Scanner readability depends on printer quality, paper, barcode size, and the scanner model.
  • Tracking fields only work on orders that already have fulfillment tracking data.
  • SKU barcodes are only useful if the SKU format is scannable in the warehouse workflow.
  • Variant barcode output depends on variant barcode data being populated in Shopify.
  • Very long values can create codes that need more width than a dense packing slip can provide.
  • This generator creates copy-paste Liquid snippets; it does not install code into Shopify automatically.