Packing slip metafield

Add product metafields to a Shopify packing slip

Generate Shopify Order Printer Liquid for product, variant, order, or customer metafields on packing slips.

Quick answer

Add product metafields 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 %}

Blank metafield diagnosis

Fix blank Shopify Order Printer metafields before changing the whole template.

Most blank metafields come from the wrong owner object, a display label used as the namespace/key, missing test-order data, or product/variant code outside the line item loop.

Symptom Check first Fix
Fallback text prints instead of the metafield value Confirm the Shopify admin namespace and key, not the display label shown to staff. Use object.metafields.namespace.key.value and test with an order that has the field populated.
Product or variant metafield is blank Check whether the snippet is inside the line item loop and whether the value belongs to product or variant. Use line_item.product.metafields... for product data or line_item.variant.metafields... for variant data.
Customer or order metafield repeats on every item row Look for order-level or customer-level code pasted inside the item table loop. Move order and customer metafields to the order details, billing, or customer section.
Shopify admin shows a value but Order Printer does not Verify owner object, test order data, namespace/key spelling, and whether the metafield requires .value. Preview a real order with the matching product, variant, customer, or order metafield before saving.

Free first, fix when needed

Use the generator for the first safe test.

Generate a metafield block with label, fallback text, and placement guidance. If the snippet works alone but your real Shopify Order Printer template has custom loops, tables, print CSS, app fields, or compliance-sensitive wording, send the current template for a scoped fix.

Packing slip metafield

Add product metafields 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

Need more than code snippets?

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.

Add metafields to Shopify Order Printer

HS code Order Printer

Add HSN or HS code to Shopify invoices

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

Add HSN or HS code to Shopify invoices

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.

Add country of origin to a Shopify invoice

Commercial invoice fields

Shopify commercial invoice template with HS code and origin

Best for cross-border merchants preparing Shopify invoice or commercial invoice templates that need item-level HS/HSN code, origin, and customs data in a printable layout.

Shopify commercial invoice template with HS code and origin

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.

Show Shopify line item properties in Order Printer

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.

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.