0
votes

Sorry in advance for the Shopify question: I am trying to finish a store for my friend and he needs the shopping cart to sort the items by what Collection they are in. This is a menu for fresh food delivered daily and each collection is a day, so I am trying to display the cart by Monday, Tuesday, etc. I think I have an idea of how to do this in liquid, but am new to Shopify and liquid, so please forgive me. I think the two routes could be by using product.collections (which returns a list of all collections that an item is part of), or by using tags on each item and using product.tags to return that tag. Then by using these I can display them appropriately on the page. UPDATE: I have most of the logic there, I just can't seem to put the labels in correctly now.

{% for item in cart.items %}
{%if item.product.tags contains 'Monday' %}

This displays what I need as far as the items in the right order, my problem now is getting only 1 title or h4 to appear for each category.

Any help would be greatly appreciated.

1

1 Answers

0
votes

Nevermind, all I had to do was add a table head with the tag name above each of:

{% for item in cart.items %}
{%if item.product.tags contains 'Monday' %}

Everything came out wonderfully!