How to output product title of all products with specific tag in customers/account

Topic summary

A Shopify developer using the Debut theme needs to display product titles on the customers/account page, but only for products that contain a specific tag matching one of the customer’s tags.

Proposed Solution:

  • First, check if the customer has a specific tag using a loop through customer.tags
  • If the tag exists, retrieve products from a collection using collections[handle]
  • Loop through the collection’s products and filter by product tags
  • Display product titles that match the criteria using {{ product.title }}

Key Technical Elements:

  • Use Liquid’s {% for tag in customer.tags %} to check customer tags
  • Use {% paginate collection.products by 99 %} to handle product lists
  • Nest loops to filter products by their tags (e.g., ‘limited_edition’)
  • The code requires testing on a backup/demo store before implementation

Note: The original post and some code snippets appear reversed/mirrored in the conversation, making exact syntax difficult to verify. The solution involves combining customer tag checking with product collection filtering through nested Liquid loops.

Summarized with AI on November 25. AI used: claude-sonnet-4-5-20250929.

I’m using Debut.

On my customers/account, I need to output a list of product titles of all products containing a specific tag. This specific tag needs to be referenced by using “customer.tags.first”. Is this possible to achieve?

I’m thinking something like this, but it doesn’t work:

{% for product in tags[customer.tags.first].products %}
{{ product.title }}
{% endfor %}

I think what you want to achieve is something like this:

  1. Only output product titles on the account page if the “customer tag” contains a specific tag like for example “wholesaler” tag.

  2. When the customer tag exists (true), then you want to output product titles and stuff if the product contains a specific tag like “new”.

Your solution is a bit more complex i think.

Maybe try this approach.

  1. check if the specific customer tag exists

(ref: https://help.shopify.com/en/themes/liquid/objects/customer#customer-tags)

({% for tag in customer.tags %}
  {% if tag == 'myTag' %}

  {% endif %}
{% endfor %}
  1. get the products object by getting a specific collection using its handle something like:

(ref: https://help.shopify.com/en/themes/liquid/objects/collection#collection-products )

{% assign collection = collections[my-collection-handle] %}
  
  {% paginate collection.products by 99 %}
  {% assign products = collection.products %}

  {% if collection.products.size > 0 %}

  {% for product in products %}
    {% for tag in product.tags %}
      {% if product.tag == 'limited_edition' %}
        <p>{{ product.title }}</p>
      {% endif %}
    {% endfor %}
  {% endfor %}

  {% endif %}

  {% endpaginate %}

so all put together this could look like this (please make a backup of your theme or edit/try this on a demo store *not tested):

{% for tag in customer.tags %}
  {% if tag == 'myTag' %}

  {% assign collection = collections[my-collection-handle] %}
  
  {% paginate collection.products by 99 %}
  {% assign products = collection.products %}

  {% if collection.products.size > 0 %}

  {% for product in products %}
    {% for tag in product.tags %}
      {% if product.tag == 'limited_edition' %}
        <p>{{ product.title }}</p>
      {% endif %}
    {% endfor %}
  {% endfor %}

  {% endif %}

  {% endpaginate %}
    
  {% endif %}
{% endfor %}

… i hope this gets you closer to what you want.

1 Like

If you want to call product title in any of the page please write the code on particular product title place is {{product.title}}