Access JSON Product metafield in Order Printer app

1 0 0

I've been trying to access a JSON typed metafield from a Product, via the Order Printer app, using a new template. I can output the JSON as a string, but I cannot, whatever I try, access the JSON as an object.


This will output the string of the JSON object:

{% for line_item in line_items %}
  {% assign product_pkgs = line_item.product.metafields.packages.value %}

  {{ product_pkgs }}
{% endfor %}


If I use the JSON filter I receive output: "Liquid error: internal"
  { product_pkgs | json }}


If I shared everything I have tried, this post would be much too long. I have contacted Shopify Support about 10 days ago who while they tried to be helpful ultimately I haven't heard back from them after they said they would take the issue to their backend support team.


Any ideas?


I'm thinking I might need to resort to accessing the JSON string via JavaScript and render the invoice that way, using whatever client libraries are available. I hope not...


Replies 0 (0)