I’ve raised a product custom metafield and am now trying to call it into a label in Shopify Order Printer using the below liquid but am getting no values returned
Hi , thanks for taking the time to respond. The metafield name was cut and paste from the metafield setup screen to guarantee it’s been input correctly, so that’s definitely correct. I’ve tried the approach but that’s not worked either.
I’ve just noted that I cannot seem to pull any product values at all.
Hi, I am experiencing the same issue. I am trying to extract product custom meta fields using a python script via the API. I can extract the product ID but not the meta fields, even though the meta fields exist and even pinned on the product page. These meta fields that I couldn’t access are of the rich text type, but I can access some meta fields that are multi line text type. I have posted this issue on the community page, didn’t get a reply yet.
Ik had the same problem with metafields, and it seems that there is some case sensitive issues here. custom.eventname did not give me any values, but custom.EventName did. You can check the names of your metafield by pasting the liquid below
{% for metafield in product.metafields.custom %}
{{ metafield | first }}: {{ metafield | last }}
{% endfor %}
It gives you the names of the metafields as they can be reached in the liquid
The metafield itself looks correctly configured, so the issue is likely related to the object you’re accessing in Order Printer.
{{ product.metafields.custom.packed_in }} will only work if a product object is available in the template. In Shopify Order Printer, you’re usually working with line items, so try referencing the product through the line item instead:
@devcoders is right that you need to loop through line items instead of referencing product directly, but the trailing .value will likely still come back empty. In the current Order Printer app, metafields resolve straight to their value without .value, that’s actually what changed when Shopify migrated from Order Printer Legacy: product.metafields.manufacturerid.value became product.metafields.custom.manufacturerid. So inside the loop:
{% for line_item in line_items %}
{{ line_item.product.metafields.custom.packed_in }}
{% endfor %}
@Anchoright the reason your original snippet returned nothing is that product isn’t an object Order Printer templates expose at the top level, order-based templates only give you order, line_items, and shop. That’s almost certainly the actual bug, not a namespace or key typo.
One more thing worth checking: if packed_in is a rich text type field rather than single line text, it comes back as a JSON blob and outputting it directly won’t render anything useful, you’d need {{ line_item.product.metafields.custom.packed_in | metafield_tag }} to get it as HTML.
The metafield definition looks fine, so the issue is likely related to the object available in Order Printer, not the metafield itself.
In an Order Printer template, procuct usually isn’t available as a top-level object. Instead, you typically need to access the product through each line item. For example: