Can anyone tell me why this code refuses to be accepted by Shopify Flow please?
{% for line_item in order.line_items %}
{% if line_item.product.metafields.availability contains ‘NOT Available’ or line_item.product.metafields.logistics contains ‘Item is not available to order’ %}
{{line_item.sku}}
{% endif %}
{% endfor %}
It looks like the error message is indicating that the variable “line_items” is not valid and needs to be replaced.
Some possible causes of this error could include:
“line_items” is not a valid variable within the context of your code
There is a typo in the variable name, and it should be “line_item” instead
You are using an outdated version of Shopify’s Liquid template language and the variable name has been changed or deprecated.
I would recommend double-checking the variable name and making sure it is spelled correctly and that it is a valid variable in the context of your code. Also, check the version of the liquid template, if it is outdated, update it. Also, you can check Shopify’s documentation for the version you’re using to ensure that the variable is still supported.