Metafields use on Invoices with Order Printer

Shopify Partner
15 0 1

We have successfully created and populated 40,000 products with a custom field (metafield) 'warehouse location code' but note we cannot print that warehouse location code on an invoice (using the Shopify App Order Printer). According to the variables available to print, Metafields are not included???

Does anyone have a work around? This seems to be a serious flaw in an otherwise great invoice creation tool.

Shopify Partner
15 0 1

For anyone that is interested here is the work around to have metafield data (custom fields) placed onto an invoice or picking slip with Order Printer. In our case we already had a custom field (metafield) setup called custom_fields.warehouse_code which was populated with information for each product.

1/ On your product.liquid page find the <form action="/cart/add"> tag and insert the following code within the form tags:

{% if product.metafields.custom_fields.warehouse_code %}
       {% assign warehouse-code = product.metafields.custom_fields.warehouse_code %}
{% endif %}
<input id="warehouse-code" type="hidden" name="properties[_Warehouse Code]" value="{{ warehouse-code }}">

2/ On your Order Printer template insert the following code where you wish the custom field data (metafield data) needs to display:

{% for line_item in line_items %}
Warehouse Code: {% for property in %}{{ property.last }}{% endfor %}
{% endfor %}

Hope this helps someone else.

New Member
1 0 0

To create an invoice in a specific language, its unique language code has to be added as additional order information. View Epson Error Code 0xf1 to know about printer errors.

New Member
2 0 0

Unfortunately, I couldn't find any 

<form action="/cart/add">

on the product.liquid page in my store. Did something change in the last 2 1/2 years? Does somebody know how to fix this or if there is a better method by know?


Thanks in advance,


Shopify Expert
167 0 39

Try the product template in the sections folder. It's probably in that file.

Head fox at Elkfox | App and web, design and development | Digital commerce experts |