Order Printer template - display product collections

Topic summary

A developer is attempting to display product collections in a custom Order Printer template but encountering issues with the Liquid code.\n\nProblem Details:\n- Three debug attempts all fail:\n - {{line_item.product | json}} returns \

Summarized with AI on November 12. AI used: claude-sonnet-4-5-20250929.

Hi All,

I’m trying to display the product’s collections on a custom Order Printer template. But I get nothing or errors.

{% for line_item in line_items %}
  <!-- 1. debug --> 
  {{line_item.product | json}}

  <!-- 2. debug -->
  {{line_item.product.collections.first | json}}

  <!-- 3. output collections -->
  <p>Collections: {% for coll in line_item.product.collections %}{{coll.title}}{% endfor %}</p>
{% endfor %}
  1. outputs Liquid error: internal

  2. outputs Liquid error: internal

  3. outputs Collections:

This suggests to me that the Order Printer liquid is different to the normal Shopify liquid API and that the product object of line_item doesn’t include collections like the api suggests. Does anyone know if this is true? or am I missing something with my code?

I also can’t explain why 1. doesn’t work. any thoughts?

Many thanks

Hey, perhaps if no one knows the answer to getting the collections, does anyone know why my debug isn’t working?

… Or what the schema is for the Order Printer template objects?

If I can find out what props are available to me, I can take it from there. But I can’t figure out a way of finding out what props i have.

Cheers