New Order Printer to Show Product line item Meta Fields

Solved

New Order Printer to Show Product line item Meta Fields

Raxsoller
Tourist
8 0 2

Hello,

 

We Installed the New Order Printer App (Because the legacy App with be discontinued soon). But when we migrate our templates, it won't show the product meta fields anymore. 

We created a packing slip template to show Bin Locations so we can easily find products when picking.

 

We use the code: {{ line_item.product.metafields.bin_location.value }}

 

Please Help.

 

Thanks

Accepted Solution (1)

tim
Shopify Partner
3765 351 1384

This is an accepted solution.

Wait, usually you use line_item.product.metafields.namespace.key to fetch the metafield and line_item.product.metafields.namespace.key.value  to retrieve its value. Or bin_location is a namespace and value is a key?

Or you've simply forgotten either namespace or key?

 

If value is not a key, but metafield property, after looking at https://help.shopify.com/en/manual/orders/printing-orders/shopify-order-printer/liquid-variables-and... i think maybe you should remove it from your code.

If my post is helpful, consider liking it -- it will help others with similar problem to find a solution.
I can be reached via e-mail [email protected]

View solution in original post

Replies 5 (5)

tim
Shopify Partner
3765 351 1384

This is an accepted solution.

Wait, usually you use line_item.product.metafields.namespace.key to fetch the metafield and line_item.product.metafields.namespace.key.value  to retrieve its value. Or bin_location is a namespace and value is a key?

Or you've simply forgotten either namespace or key?

 

If value is not a key, but metafield property, after looking at https://help.shopify.com/en/manual/orders/printing-orders/shopify-order-printer/liquid-variables-and... i think maybe you should remove it from your code.

If my post is helpful, consider liking it -- it will help others with similar problem to find a solution.
I can be reached via e-mail [email protected]
Raxsoller
Tourist
8 0 2

Hello, That is the exact code we use on the old Order printer and it works. Thanks for the link you send it helps me compose the correct code. So I use:

{{ line_item.product.metafields.custom.bin_location }}

and it works in the new Order Printer.

 

DGFlyer03
Visitor
2 0 1

In the legacy Order Printer app, product metafields and their namespaces were not handled correctly, so the workaround line_item.product.metafields.key.value was used (note the lack of a namespace). In the new Order Printer app, this appears to be fixed, so line_item.product.metafields.namespace.key works as documented.

RichardEP
Tourist
5 0 3

Would it be possible to see what that section of your template looks like for the product and the metafield information? I would love to be able to do the same for our picking lists, I thought it was not possible with the Shopify Order Printer app.

 

Thanks

Raxsoller
Tourist
8 0 2

Hello @RichardEP ,

 

Here's the sample of our Packing Slip:

Hope this helps

Raxsoller_0-1717980890666.png