I’m doing some work for a family friend, they have a shop in iZettle which is using liquid templates. I’m trying to sort my products by weight but having no luck. I can’t even log any data using {{ variable | json }}
. I’ve not touched php for a long time and never used liquid so really struggling.
<ul class="tiles">
{% assign sortedItems = (category.items | sort: 'item.quantity_unit') %}
{% for item in sortedItems %}
{{ item | json }}
{% include tile-item.liquid %}
{% endfor %}
</ul>
Doesn’t change the order at all. Don’t get any output from {{ item | json }}
. I don’t know why the item
data is not accessible
3
Answers
Turns out iZettle completely restrict which liquid templating options you can use
What does {{ sortedItems | json }} returns?
you could try removing “()” from the assignment.
In regular liquid, this works :
{% assign sortedItems = (category.items | sort: 'quantity_unit') %}
.But sadly your question is based on code nobody can see. The better option is to ask this question to iZettle support.