Hello, I am hoping someone can help. I have been working on updating our website to the new Shopify OS theme Refresh and have encountered an issue with the collections list. We have some custom code on our current website that achieved the A-Z structure with large letters etc.
{% comment %} The code below calls in the brands starting with letters from A-Z, then the numbers from 0-9 {% endcomment %}
{% assign current = "" %}
{% for collection in collections %}
{% unless collection.title == 'Accessories' or collection.title == 'Beauty' {% assign first_letter = collection.title | strip_html | upcase | truncate: 1, '' %}
{% if "0123456789" contains first_letter %} {% continue %} {% endif %}
{% unless first_letter == current %}
- {{ first_letter }}
{% endunless %}
- {{ collection.title }}
{% assign current = first_letter %}
{% endunless %}
{% endfor %}
{% for collection in collections %}
{% assign first_letter = collection.title | strip_html | upcase | truncate: 1, '' %}
{% unless "0123456789" contains first_letter %} {% break %}{% endunless %}
{% unless first_letter == current %}
- {{ first_letter }}
{% endunless %}
- {{ collection.title }}
{% assign current = first_letter %}
{% endfor %}
Here is where I have got to with the refresh theme… but I can’t get the A-Z function working or indeed even reduce the size of the collection cards. Please can someone help?
Thank you for this code, I’ve put it in and it has worked. Is there an easy adjustment to have the brands listed in multiple columns underneath their respective letter?