<p>Hoping this is what you are looking to do?</p>

<pre><code>{% for productType in craft.commerce.productTypes %}

  {{ productType.name }}&lt;br&gt;

{% for product in craft.commerce.products.type(productType.handle).find() %}

  {{ product.title }}&lt;br&gt;

{% endfor %}

{% endfor %}
</code></pre>

CC BY-SA 3.0
2016-10-27T18:48:04.850Z
2016-10-27T18:48:04.850Z
Luke Holder
<p>I am trying to have a overview page where I want to loop through all available product categories in separate rows. Somehow I was only able to achieve it when I specify the type of the product. That isn't ideal since I want the customer to be able to add new product types which will be displayed in a new row then. </p>

<p>Something like this :</p>

<pre><code>{% set products = craft.commerce.products.type('all').find() %}

{% for 'type #1' in products %}
    ...
{% endfor  %}

{% for 'type #2' in products %}
    ...
{% endfor  %}

etc..
</code></pre>

<p>thanks a lot guys </p>

<templating><plugin-craftcommerce>
How can I loop through all different Product Types in Craft Commerce?
# How can I loop through all different Product Types in Craft Commerce?

(Asked by: username_0 on 2016-10-27)

I am trying to have a overview page where I want to loop through all available product categories in separate rows. Somehow I was only able to achieve it when I specify the type of the product. That isn't ideal since I want the customer to be able to add new product types which will be displayed in a new row then. 
Something like this :
{% set products = craft.commerce.products.type('all').find() %}

{% for 'type #1' in products %}
    ...
{% endfor  %}

{% for 'type #2' in products %}
    ...
{% endfor  %}

etc..

thanks a lot guys

**Tags:** templating, plugin-craftcommerce

---

## 1 answers

### Answer by username_1 on 2016-10-27. Score: 3 | Accepted answer

Hoping this is what you are looking to do?
{% for productType in craft.commerce.productTypes %}

  {{ productType.name }}

{% for product in craft.commerce.products.type(productType.handle).find() %}

  {{ product.title }}

{% endfor %}

{% endfor %}


---

