<p>Something like this?</p>

<pre><code>  {% if item.discount %}
  &lt;tr&gt;
    &lt;td&gt;Your discount is {{ item.discount|commerceCurrency( currency ) }}&lt;/td&gt;
  &lt;/tr&gt;
  {% endif %}
</code></pre>

CC BY-SA 3.0
2017-04-11T08:30:20.390Z
2017-04-11T08:30:20.390Z
Seth Warburton
<p>For some reason the <code>{% if item.discount %}</code> isn't working for me.
I've solved it by comparing the item.discount value. If not 0.0000 then it may show up</p>

<pre><code>{% if item.discount != '0.0000' %} 
  {{"Discount"|t}}: {{ item.discount|commerceCurrency(cart.currency) }}&lt;br&gt;
{% endif %}
</code></pre>

CC BY-SA 3.0
2017-08-17T09:44:01.197Z
2017-08-17T09:44:01.197Z
iDzine
<p>I would like to do two things in my Craft commerce templates:</p>

<p><strong>In my product template:</strong></p>

<p>Check if there are any discounts available to a specific product.</p>

<p>I have a way to output discounts but need to be able to check if there are any at all because the pricing table would look entirely different for either one of the two cases.</p>

<p><strong>In my shopping cart template:</strong></p>

<p>I would like to check (1) if there are any discounts applied to a line item in the shopping cart and, if there are, (2) I would like to display the discount amount for that line item.</p>

<p>This way, I can avoid showing a zero discount like this:
"Your discount: $0.00"</p>

<p><em>Thank you for your help.</em></p>

CC BY-SA 3.0
2017-07-24T15:55:22.150Z
If an answer provides a solution to your problem it's good etiquette, and good manners, to mark it as the correct answer.
Seth Warburton
<plugin-craftcommerce><discounts>
Check if there is a discount and, is yes, how much
# Check if there is a discount and, is yes, how much

(Asked by: username_0 on 2017-03-30)

I would like to do two things in my Craft commerce templates:

**In my product template:**

Check if there are any discounts available to a specific product.

I have a way to output discounts but need to be able to check if there are any at all because the pricing table would look entirely different for either one of the two cases.

**In my shopping cart template:**

I would like to check (1) if there are any discounts applied to a line item in the shopping cart and, if there are, (2) I would like to display the discount amount for that line item.

This way, I can avoid showing a zero discount like this:
"Your discount: $0.00"

*Thank you for your help.*

**Tags:** plugin-craftcommerce, discounts

> **Comments:**
> **username_1**: If an answer provides a solution to your problem it's good etiquette, and good manners, to mark it as the correct answer.  

---

## 2 answers

### Answer by username_1 on 2017-04-11. Score: 2

Something like this?
  {% if item.discount %}
  
    Your discount is {{ item.discount|commerceCurrency( currency ) }}
  
  {% endif %}


---

### Answer by username_2 on 2017-08-17. Score: 1

For some reason the {% if item.discount %} isn't working for me.
I've solved it by comparing the item.discount value. If not 0.0000 then it may show up
{% if item.discount != '0.0000' %} 
  {{"Discount"|t}}: {{ item.discount|commerceCurrency(cart.currency) }}
{% endif %}


---

