Metafields use on Invoices with Order Printer

Highlighted
Shopify Partner
16 0 2

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.

0 Likes
Highlighted
Shopify Partner
16 0 2

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 line_item.properties %}{{ property.last }}{% endfor %}
{% endfor %}

Hope this helps someone else.

1 Like
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.

0 Likes
Highlighted
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,

Niklas 

0 Likes
Highlighted
Shopify Expert
166 0 39

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

Elkfox - The eCommerce Experts
0 Likes
Highlighted
New Member
1 0 0

Hey,

 

I am also struggling with finding this line. It isn't in the product.template either. Is this workaround not good anymore?

 

Cheers,

Will

 

0 Likes
Highlighted
Shopify Expert
166 0 39

This should still work just fine. I'd recommend hiring an expert to help with it if you aren't an experienced Shopify themes developer.

Elkfox - The eCommerce Experts
0 Likes
Highlighted
Shopify Partner
40 0 6

Thanks @Adam_Robson 

 

Do you know how to get this information (variant's metafields) in order printer if you create the order in the dashboard? 

 

Thanks

0 Likes
Highlighted

This solution above will come with issues on high volume stores.
Orders processed in certain ways will not have the data captured as the user will not physically add to cart from the product page.
e.g. we have issues with permalinks + abandoned cart emails - as mentioned above alse via dashboard.  There are many cases when you look into it.

 

We can build a small addon app if enough people need this. email Joe@
hello@liquify.design

★★★ Need help setting up your Shopify store? Hire me here: https://liquify.design ★★
0 Likes
Highlighted
Shopify Partner
75 0 26

Had this come up elsewhere, found this thread while trying to find out if Order Printer had proper metafield support. Seems it doesn't. :)

 

Mechanic (apps.shopify.com/mechanic) is able to generate PDFs for any purpose, with any content, using any data available via the Shopify API. This includes metafields, and also fulfillment location information (which Order Printer doesn't have either, from what I understand).

 

Note that Mechanic is a general-purpose development tool, not just a PDF generator, and you may need a developer's help building something custom with it.

 

For information on bringing your Order Printer templates over to Mechanic, see Migrating templates from Shopify to Mechanic.

I made Locksmith and Mechanic. :)
2 Likes