Packing slip metafield

Add a metafield to a Shopify packing slip

Generate Order Printer Liquid for adding product, variant, order, or customer metafields to a Shopify packing slip.

Quick answer

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

Generate a metafield block with label, fallback text, and placement guidance. Start in a duplicate Shopify Order Printer template, paste the Liquid in the right placement area, and preview with real orders before saving.

  1. Find the metafield namespace and key in Shopify admin.
  2. Choose whether the field belongs to product, variant, order, or customer.
  3. Paste product and variant fields inside the packing slip line item loop.

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.

{% for line_item in line_items %}
  {% assign opk_value = line_item.product.metafields.custom.your_key.value %}
  {% if opk_value != blank %}
    <p><strong>Product detail:</strong> {{ opk_value }}</p>
  {% endif %}
{% endfor %}

Packing slip metafield

Add a metafield to a Shopify packing slip

Generate a metafield block with label, fallback text, and placement guidance.

Standard order with one clear product row.
Need a blank product metafield row fixed?

Product and variant metafields usually print blank when they are outside the item loop or stored on the other owner object.

Fix blank metafield output

Paid feature signals

Generated Liquid

Copy-paste code

{% for line_item in line_items %}
  {% assign opk_metafield = line_item.product.metafields.custom.country_of_origin.value %}
  {% if opk_metafield != blank %}
    <p class="opk-line-metafield">
      <strong>Country of origin:</strong> {{ opk_metafield }}
    </p>
  {% else %}
    <p class="opk-line-metafield opk-muted">
      <strong>Country of origin:</strong> Not provided
    </p>
  {% endif %}
{% endfor %}

Install wizard

Place the snippet before testing output.

1
Template area

Line item loop

2
Paste target

Paste inside the line item loop so each product can read its own metafield.

3
Test order

Order whose selected owner has this metafield filled in

Paste location

Paste inside the line item loop so each product can read its own metafield.

Test checklist

  • Duplicate the Shopify Order Printer template before editing the live one.
  • Preview with the regular order.
  • Use an order whose product, variant, customer, or order data has the field filled in.
  • Print or save one test preview before using the template in production.

Common failure

  • The metafield owner is wrong, such as using order when the field is on product.
  • The namespace uses a dash or typo that does not match Shopify admin.
  • The template prints fallback text because the test order has no metafield value.

Mock preview

#1048Standard order with one clear product row.

Country of origin: United States

Use case

When to use this tool

Best for merchants adding HS codes, country of origin, pick notes, wholesale fields, or product specs to warehouse documents.

Separates product and variant metafields from order and customer fields.

Includes fallback text for blank values.

Explains why placement inside the line item loop matters.

Free tool fit

Use the snippet when the edit is narrow.

Generate a metafield block with label, fallback text, and placement guidance.

  • 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.

Send your packing slip template and get the metafield inserted into the correct row or section.

  • 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 Find the metafield namespace and key in Shopify admin.
  2. Step Choose whether the field belongs to product, variant, order, or customer.
  3. Step Paste product and variant fields inside the packing slip line item loop.
  4. Step Preview with an order that has the metafield populated.

FAQ

Common Shopify Order Printer issues

Should product metafields go inside each item row?

Usually yes. Product and variant metafields belong near the line item they describe.

Can I add country of origin to every item?

Yes, if country of origin is stored as a product or variant metafield.

What if my data is a line item property?

Line item properties use a different loop and are a good candidate for a scoped code fix.

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

HS code Order Printer

Add HS codes to Shopify Order Printer

Best for cross-border merchants who need an HS code column on a commercial invoice, customs packing slip, or export document built in Shopify Order Printer.

Open related fix

Country of origin invoice

Add country of origin to a Shopify invoice

Best for merchants whose commercial invoice or customs document needs origin printed per line item, especially when variants can have different origins.

Open related fix

Commercial invoice fields

Shopify commercial invoice template for Order Printer

Best for cross-border merchants preparing document templates that need item-level customs data in a printable layout.

Open related fix

Line item properties

Show Shopify line item properties in Order Printer

Best for merchants whose product options, personalization notes, bundle details, or gift messages are stored as line item properties instead of metafields.

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

Alternative comparison

Order Printer Pro alternative for small fixes

Compare one-off Liquid edits with full invoice automation.

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

Barcode snippet generator

add a barcode to a Shopify packing slip

Print order, SKU, variant, tracking, or QR codes.

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

Liquid objects

Fields this page usually touches

  • line_item.product.metafields.namespace.key
  • line_item.variant.metafields.namespace.key
  • order.metafields.namespace.key
  • customer.metafields.namespace.key

Common errors

Watch these before saving

  • The metafield owner is wrong, such as using order when the field is on product.
  • The namespace uses a dash or typo that does not match Shopify admin.
  • The template prints fallback text because the test order has no metafield value.

Limits

What this does not replace

  • Metaobject and list metafields may need custom formatting.
  • This page does not validate whether the value is legally sufficient for customs or tax.
  • Fields added by third-party apps may use line item properties instead of metafields.