Adding an Alphabetical list of products in debut theme

Hi everyone! I’m trying to add an alphabetical list of the products in my page, trying to change the following code:


  {% assign current = "" %}
  {% for product_vendor in shop.vendors %}
    {% assign first_letter = product_vendor | strip_html | upcase | truncate: 1, '' %}
    {% unless first_letter == current %}
      - {{ first_letter }}

    {% endunless %}
    - {{ product_vendor | link_to_vendor }}
    {% assign current = first_letter %}
  {% endfor %}

The problem is that the code retry a list of the vendors in alphabetical order, but when i try to change it to get the products title i get an error. I guess that I ain’t doing it correctly. Has anyone a solution for this?

My site is fotosprorio.com

Many Thanks!

Hey, @LucasAlbuq

Just to clarify, are you trying to organize your products on a specific collection page so that they display in a specific order (in your case alphabetical)? If so, this can be edited within your collection page settings in the Shopify admin. Screenshot below:

I hope that helps. If there is anything else I can help you with, please let me know.

Hi @Dirk ,

No. I want to make an index with the name of all the artists that are participating of the project of the website. However, their names are in the product title. So the tag product_vendors ain’t work. I need to find a way to the code that I posted before make a list from A-Z of the products title.

@Dirk with the code below


  {% assign current = "" %}
  {% for product_vendor in shop.vendors %}
    {% assign first_letter = product_vendor | strip_html | upcase | truncate: 1, '' %}
    {% unless first_letter == current %}
      - {{ first_letter }}

    {% endunless %}
    - {{ product_vendor | link_to_vendor }}
    {% assign current = first_letter %}
  {% endfor %}

I get this page

I want to make the same, but getting the A-Z list of the product’s title instead of the vendors.

Hey everybody, i’ve tried to edit the code but i can’t get anywhere…