Liquid, JavaScript, themes, sales channels
Hey there,
I'm trying to create a section within the Simple Shopify theme that filters collections based on customer tags. For example, the customer has the following tags "Foo", "Bar". In turn display a collection list with only "Foo", "Bar".
I duplicated the collection-list.liquid for my base and made the following edits.
<!-- the magic -->
{% if customer.tags.size >0 %}
<div class="collection-grid">
<div class="grid grid--uniform">
{% for tag in customer.tags %} // check customer tags
{% for link in linklists.main-collections.links %} // loop through collection menu
{% if link.title == tag %} // if a link matches customer tag then do
<div class="grid__item {{ grid_item_width }} slide-up-animation animated" {{ block.shopify_attributes }} role="listitem">
{%- assign collection = collection.tags -%} // Here's where I'm stuck, im not sure what to fill out here in order to display the correct collection based on the found tag.
{% include 'collection-grid-item' %}
</div>
{% endif %}
{% endfor %}
{% endfor %}
</div>
</div>
{% endif %}
Any help I could get with this would be greatly appreciated.
Thanks
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024