Hi

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

{{ product.metafields.custom.packed_in }}

There are values against the product.

Below is the setup for the metafield

Any suggestions?

This could be happen because of the several resons some are the below.

  • First you need to verify either your metafield namespace is exactly “custom” (case sensitive).
  • Verify the metafield key is exactly “packed_in”
  • Verify your access methods. If it’s not work then try this instead.
{{ product.metafields.custom["packed_in"] }}
{{ product.metafields["custom"]["packed_in"] }}
  • Confirm either you accessing the correct product object.

By verify these steps you will be able to resolve the issue that you facing.

If you need further help then let me know.

Thanks

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 :slight_smile:

{% 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

Hi @Anchoright

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:

{{ line_item.product.metafields.custom.packed_in.value }}

or, depending on your template:

{{ item.product.metafields.custom.packed_in.value }}

Best regards,
Devcoder :laptop:

@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.

HI @Anchoright

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:

{{ line_item.product.metafields.custom.packed_in }}

or, if you’re already looping through the order’s line items:

{% for line_item in order.line_items %}
  {{ line_item.title }} - {{ line_item.product.metafields.custom.packed_in }}
{% endfor %}

If that still returns blank, check that:

  • The metafield has a value on the product (not just the variant).
  • The template is using the correct object (line_item.product rather than product).
  • The order printer app supports accessing product metafields in your template context.

If you can share the relevant section of your Order Printer template, it’ll be easier to identify exactly where the liquid needs to be adjusted.