Adding an Alphabetical list of products title in debut theme

Highlighted
Tourist
12 0 2

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

 

<ul>
  {% assign current = "" %}
  {% for product_vendor in shop.vendors %}
    {% assign first_letter = product_vendor | strip_html | upcase | truncate: 1, '' %}
    {% unless first_letter == current %}
      <li class="vendor-letter">{{ first_letter }}</li>
    {% endunless %}
    <li>{{ product_vendor | link_to_vendor }}</li>
    {% assign current = first_letter %}
  {% endfor %}
</ul>

 

 

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?

Many Thanks!

0 Likes