HS code Order Printer

Add HS codes to Shopify Order Printer

Generate item-level Liquid for printing HS codes from product or variant metafields in Shopify Order Printer templates.

Quick answer

Add HS codes to Shopify Order Printer for Shopify Order Printer

Generate the HS code metafield block, choose product or variant storage, and place it inside the line item table before testing real orders. Start in a duplicate Shopify Order Printer template, paste the Liquid in the right placement area, and preview with real orders before saving.

  1. Create or confirm a metafield such as custom.hs_code on products or variants.
  2. Use product metafields when the HS code is identical across every variant of the product.
  3. Use variant metafields when material, bundle contents, size, or manufacturing setup changes the classification.

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 %}
  <p>
    {{ line_item.title }} -
    HS {{ line_item.product.metafields.custom.hs_code.value | default: "Missing HS code" }},
    {{ line_item.product.metafields.custom.country_of_origin.value | default: "Missing origin" }}
  </p>
{% endfor %}

HS code Order Printer

Add HS codes to Shopify Order Printer

Generate the HS code metafield block, choose product or variant storage, and place it inside the line item table before testing real orders.

Standard order with one clear product row.
Need customs fields aligned with item rows?

Commercial invoice fields are safest when HS code, origin, description, quantity, and item title stay together in the item table.

Add customs fields to my item table
Validate a commercial invoice starter pack

Use this when you need a focused commercial invoice starter with item-level HS code, origin, and description fields.

Request commercial invoice pack

Paid feature signals

Generated Liquid

Copy-paste code

{% for line_item in line_items %}
  <div class="opk-customs-row">
    <strong>{{ line_item.title }}</strong>
    <ul>
      <li><strong>HS code:</strong> {{ line_item.product.metafields.custom.hs_code.value | default: "Missing HS code" }}</li>
      <li><strong>Country of origin:</strong> {{ line_item.product.metafields.custom.country_of_origin.value | default: "Missing origin" }}</li>
      <li><strong>Customs description:</strong> {{ line_item.product.metafields.custom.customs_description.value | default: line_item.title }}</li>
    </ul>
  </div>
{% endfor %}

Install wizard

Place the snippet before testing output.

1
Template area

Commercial invoice item table

2
Paste target

Paste inside the item loop or commercial-invoice item table so each line gets its own customs data.

3
Test order

Cross-border order with HS code, origin, and missing-field cases

Paste location

Paste inside the item loop or commercial-invoice item table so each line gets its own customs data.

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 HS code block is pasted outside the line item loop.
  • A product metafield is used even though different variants need different classifications.
  • The metafield definition exists, but some products or variants have blank HS code values.

Mock preview

#1048Standard order with one clear product row.
  • HS code: 6912.00
  • Country of origin: United States
  • Customs description: Blue ceramic mug

Use case

When to use this tool

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.

Targets the exact HS code field instead of treating customs as one generic page.

Explains product metafields versus variant metafields for classifications that change by material, kit, size, or country.

Keeps HS code output inside the line item loop so every purchased item can print its own value.

Pairs HS code with customs description, country of origin, quantity, and destination checks.

Keeps customs language cautious and points merchants to carrier, broker, or internal compliance review before shipment.

Free tool fit

Use the snippet when the edit is narrow.

Generate the HS code metafield block, choose product or variant storage, and place it inside the line item table before testing real orders.

  • 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 commercial invoice template when HS codes need to be merged into an existing item table with quantity, origin, description, and tax notes.

  • 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 Create or confirm a metafield such as custom.hs_code on products or variants.
  2. Step Use product metafields when the HS code is identical across every variant of the product.
  3. Step Use variant metafields when material, bundle contents, size, or manufacturing setup changes the classification.
  4. Step Generate the HS code Liquid block and paste it inside the commercial invoice item loop.
  5. Step Place the HS code near customs description, country of origin, quantity, and item title.
  6. Step Preview a multi-item order with one filled HS code, one missing HS code, and one variant-specific HS code.
  7. Step Have the merchant, carrier, broker, or compliance workflow verify classifications before production use.

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.

HS code prints blank for some items.

Likely cause
The selected product or variant metafield is empty on those items, or the snippet is outside the item loop.
Fix
Fill the HS code metafield on every product or variant used in the test order, then paste the snippet inside the line item loop.

Every variant prints the same HS code.

Likely cause
The template reads a product metafield even though variants need separate classification values.
Fix
Store HS code on variant metafields and switch the path to line_item.variant.metafields.custom.hs_code.value.

The customs table is hard to audit.

Likely cause
HS code is printed without nearby item title, customs description, origin, or quantity.
Fix
Place HS code in the item table next to title, customs description, country of origin, and quantity.

FAQ

Common Shopify Order Printer issues

Where should HS codes be stored for Order Printer?

A simple first setup is a product or variant metafield such as custom.hs_code, then print that value inside the line item loop.

Should HS code be a product metafield or variant metafield?

Use product metafields when every variant shares one classification. Use variant metafields when material, kit contents, size, or origin can change the HS code.

Can OrderPrintKit tell me the correct HS code?

No. It helps print the value you store in Shopify. Classification decisions should be verified by the merchant, carrier, broker, or advisor.

Can I add HS code to a packing slip instead of a commercial invoice?

Technically yes if the field is available, but customs documents usually need more context than a normal warehouse packing slip.

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.

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

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

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

Packing slip metafield

Add a metafield to a Shopify packing slip

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

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

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.custom.hs_code.value
  • line_item.variant.metafields.custom.hs_code.value
  • line_item.product.metafields.custom.customs_description.value
  • line_item.variant.metafields.custom.country_of_origin.value
  • line_item.quantity
  • shipping_address.country

Common errors

Watch these before saving

  • The HS code block is pasted outside the line item loop.
  • A product metafield is used even though different variants need different classifications.
  • The metafield definition exists, but some products or variants have blank HS code values.
  • The page prints HS codes without a customs description or country of origin column, making the document hard to review.
  • The merchant assumes template code validates HS classifications.

Limits

What this does not replace

  • This is template code help, not HS classification or customs advice.
  • The generator does not validate tariff codes, destination rules, carrier requirements, or product eligibility.
  • Kits, regulated goods, and multi-origin products may need manual document logic.
  • Carrier-generated customs forms may still be required even when an Order Printer document includes HS codes.