image object in order.line_items empty

Solved
timd
Shopify Expert
67 2 14

I've just discovered that the image object in order.line_items no longer seems to return any data. eg.

{% for line_item in order.line_items %}
    {{ line_item.image | img_url: '100x100' | img_tag }}
{% endfor %}

Same goes for the 'product' object eg. {{ line_item.product.title }}

Here it says order.line_items should give me access to all line_item objects: https://shopify.dev/api/liquid/objects/order#order-line_items

And this liquid code has been used in an existing theme I'm working on so I can only assume it was generating data objects in the past?

Anyone else having issues with this?

0 Likes
timd
Shopify Expert
67 2 14

This is an accepted solution.

I just realised that the products referred to in my order.line_items no longer exist so the image data has probably disappeared with the product

0 Likes