<p>The real answer is:</p>
<pre><code>{% for sale in variant.sales %}

    {% sale.description %}

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

CC BY-SA 3.0
2018-02-23T14:44:36.560Z
Thanks Luke; that's not something I could find in the docs for either the product or sale documentation pages. I tried to check again just but the Commerce site has been offline all day.
Matt Wilcox
CC BY-SA 3.0
2018-02-26T04:17:07.380Z
@MattWilcox I have updated the docs. Thanks.
Luke Holder
CC BY-SA 4.0
2021-05-20T12:46:47.470Z
@LukeHolder how does this work in Commerce 3, I get:

Calling unknown method: craft\commerce\elements\Variant::salesApplied()
Green17
CC BY-SA 4.0
2021-05-27T08:00:13.047Z
@Green17 It would be `for sale in variant.sales`
Luke Holder
CC BY-SA 4.0
2021-11-16T11:44:18.753Z
This shows ALL sales that are applied. Some sales override previous sales, and these sales are still displayed. Is there a possibility to only see the sales that are really applied?
outline4
CC BY-SA 4.0
2018-02-23T01:34:10.530Z
2021-05-27T08:00:18.893Z
2021-05-27T08:00:18.893Z
Luke Holder
<p>Thanks to Mike Pepper on the Slack chat, this is the answer. A bit disappointing that we need to go through hoops like this, but it works.</p>

<pre><code>{% set productSales = [] %}
{% set allSales     = craft.commerce.getSales() %}

{% for sale in allSales if product.id in sale.productIds or product.typeId in sale.productTypeIds %}
    {% set productSales = productSales|merge([sale]) %}
{% endfor %}

{% for sale in productSales if product.defaultVariant.onSale %}
    &lt;div class="sale"&gt;
        &lt;p&gt;&lt;b&gt;{{ sale.name }}&lt;/b&gt; - {{ sale.description }}&lt;/p&gt;
    &lt;/div&gt;
{% endfor %}
</code></pre>

CC BY-SA 3.0
2018-02-22T15:28:56.350Z
2018-02-22T15:28:56.350Z
Matt Wilcox
<p>It's easy to know if a product has a valid Sale applied to it with product.defaultVariant.onSale - but how do you know <em>which</em> Sales are being applied to the product? How do you output that the product is currently part of a specific named sale, and any associated content you might want to show?</p>

<plugin-craftcommerce><ecommerce>
How do you show which Sale a product has applied in Commerce?
# How do you show which Sale a product has applied in Commerce?

(Asked by: username_0 on 2018-02-22)

It's easy to know if a product has a valid Sale applied to it with product.defaultVariant.onSale - but how do you know *which* Sales are being applied to the product? How do you output that the product is currently part of a specific named sale, and any associated content you might want to show?

**Tags:** plugin-craftcommerce, ecommerce

---

## 2 answers

### Answer by username_1 on 2018-02-23. Score: 3 | Accepted answer

The real answer is:
{% for sale in variant.sales %}

    {% sale.description %}

{% endfor %}

> **Comments:**
> **username_0**: Thanks Luke; that's not something I could find in the docs for either the product or sale documentation pages. I tried to check again just but the Commerce site has been offline all day.  
> **username_1**: @MattWilcox I have updated the docs. Thanks.  
> **username_2**: @LukeHolder how does this work in Commerce 3, I get:  Calling unknown method: craft\commerce\elements\Variant::salesApplied()  
> **username_1**: @Green17 It would be `for sale in variant.sales`  
> **username_3**: This shows ALL sales that are applied. Some sales override previous sales, and these sales are still displayed. Is there a possibility to only see the sales that are really applied?  

---

### Answer by username_0 on 2018-02-22. Score: 1

Thanks to Mike Pepper on the Slack chat, this is the answer. A bit disappointing that we need to go through hoops like this, but it works.
{% set productSales = [] %}
{% set allSales     = craft.commerce.getSales() %}

{% for sale in allSales if product.id in sale.productIds or product.typeId in sale.productTypeIds %}
    {% set productSales = productSales|merge([sale]) %}
{% endfor %}

{% for sale in productSales if product.defaultVariant.onSale %}
    
        {{ sale.name }} - {{ sale.description }}
    
{% endfor %}


---

