Can I use metafields of Product of LineItem?

Erodad
Visitor
2 0 0

Hey guys,

so I added a metafield to my product called storageLocation.
It is located under product.metafields.storageLocation.storageLocation.

I'm using an app that prints out all LineItems of an order.
And I want to display the storageLocation-Field as well but it doesn't work.

The code is something like this:

{% for line_item in line_items %}
   {{ line_item.product_title }}
   {{ line_item.product.metafields.storageLocation.storageLocation }} <-- THIS DOESN'T WORK
{% endfor %}

 

I was wondering why this doesn't work, since I often used metafields for products before. But it seems that you cant reach the metafields of a product from the lineItem.

 

Hope someone can maybe try it out and help me.

 

Greetings 🙂
Dominik

Reply 1 (1)

dleaf
Visitor
1 0 0

Did you manage to figure out a solution, kinda in the same boat now!