Conversations about creating, managing, and using metafields to store and retrieve custom data for apps and themes.
Hi,
I'm trying to add
product.metafields.custom.weight
to my line item description section in packing template manually.
The goal is to display the weight of a sold item under its name and picture on the slip.
I understand metafields need a loop to be added, tried some of the suggested loops in the forum and it didn't work.
Any suggestions please?
You can show the metafield with this code
{{ product.metafields.custom.weight | metafield_tag }}
Thank you for your reply, but it didn't work.
From what I read it has to be a loop, but can't get the right loop for this one.
Hi Amir212,
It doesn't look like product metafields are supported on packing slips yet, but I've passed on this request to our internal dev team.
Thanks for your feedback!
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Any update on this or workaround?
Hi Hyperborea - there's no update just yet.
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Hello,
There're two ways to work around this that worked for me:
1- Adding variants to your products which will show on the packing slips (this worked for me perfectly).
2- Using "Wizard Labs: Invoice Wizard" app which enables you to add metafields to slips, but the only problem was that ALL fields will be displayed and it has very limited customization on the appearance (either display all or none).
I know this is an old thread and comes up in google when searching on this issue, I have custom product metafield and order metafield data on my packing slips for a while now. so I thought I would update this post for the future to help those in need out
In my packing slip I have, the following code which shows an optional PO number on the packing slip. this is just an order metafield called custom.po_number under Order metafield definitions
{% if order.metafields.custom.po_number != blank %}
<p class="text-align-right">PO Number: {{ order.metafields.custom.po_number }}</P>
{% endif %}
and I also have a custom bin location set for all my variants
In my packing slip I have the following code
This has been working now over a year, so I hope this helps someone in the future
hi!
I'm trying to replicate your bin_location coding for something similar. I have the variant metafield created and have attempted similar code to yours in my packing slip template but it never prints.
Can you possibly show me where in your packing slip template you've placed this code?