Answers.Body: <p>The real answer is:</p>
  <pre><code>{% for sale in variant.sales %}
  
      {% sale.description %}
  
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-23T14:44:36.560Z
Answers.Text: 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.
Answers.UserDisplayName: Matt Wilcox
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-26T04:17:07.380Z
Answers.Text: @MattWilcox I have updated the docs. Thanks.
Answers.UserDisplayName: Luke Holder
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-20T12:46:47.470Z
Answers.Text: @LukeHolder how does this work in Commerce 3, I get:
  
  Calling unknown method: craft\commerce\elements\Variant::salesApplied()
Answers.UserDisplayName: Green17
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-05-27T08:00:13.047Z
Answers.Text: @Green17 It would be `for sale in variant.sales`
Answers.UserDisplayName: Luke Holder
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-11-16T11:44:18.753Z
Answers.Text: 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?
Answers.UserDisplayName: outline4
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-02-23T01:34:10.530Z
Answers.LastActivityDate: 2021-05-27T08:00:18.893Z
Answers.LastEditDate: 2021-05-27T08:00:18.893Z
Answers.UserDisplayName: Luke Holder
Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-22T15:28:56.350Z
Answers.LastActivityDate: 2018-02-22T15:28:56.350Z
Answers.UserDisplayName: Matt Wilcox
Body: <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>
  
Tags: <plugin-craftcommerce><ecommerce>
Title: How do you show which Sale a product has applied in Commerce?
ThreadText: # 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 username_1; 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**: @username_0 I have updated the docs. Thanks.  
  > **username_2**: @username_1 how does this work in Commerce 3, I get:  Calling unknown method: craft\commerce\elements\Variant::salesApplied()  
  > **username_1**: @username_2 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 %}
      <div class="sale">
          <p><b>{{ sale.name }}</b> - {{ sale.description }}</p>
      </div>
  {% endfor %}
  
  ```
  
  
  ---
  
  