<p>Assuming you've already got the product (which is a <a href="https://craftcommerce.com/docs/product-model#variants" rel="nofollow">ProductModel</a>) in Twig, it's a simple as:</p>

<pre><code>This product is available in {{ product.variants|length }} colors.
</code></pre>

CC BY-SA 3.0
2016-08-24T22:26:32.040Z
2016-08-24T22:26:32.040Z
Brad Bell
<p>Is it possible to display the number of variants a product has?</p>

<p>This would be in order to achieve the following:</p>

<blockquote>
  <p>This product is available in <strong>3</strong> colors</p>
</blockquote>

<plugin-craftcommerce>
Display number of variants as a value
# Display number of variants as a value

(Asked by: username_0 on 2016-08-24)

Is it possible to display the number of variants a product has?

This would be in order to achieve the following:

> This product is available in **3** colors

**Tags:** plugin-craftcommerce

---

## 1 answers

### Answer by username_1 on 2016-08-24. Score: 1 | Accepted answer

Assuming you've already got the product (which is a ProductModel) in Twig, it's a simple as:
This product is available in {{ product.variants|length }} colors.


---

