How to hide discount amount in the PDF Template if it is equal to zero?
Collapse
X
-
I think you need {{discountAmount_RAW}}, as the {{discountAmount}} prints a string with a zero which is not resolved to false.Leave a comment:
-
Hi yuri, I tried it but it still displays the Discount even if it is zero.
Code:<tr x-if="{{discountAmount}}"> <td colspan="5" align="right">Discount Amount</td> <td align="right">{{discountAmount}}</td> </tr>Leave a comment:
-
How to hide discount amount in the PDF Template if it is equal to zero?
Hi,
I am trying to hide the discount amount in the PDF Template if the value is equal to zero. I tried the following codes but I could not make it work.
This code displays the amount even if the discount is equal to zero
I also tried using x-if but could not make it work as well. The code below still displays the discount even if the value of discount is zero.Code:{{#if (notEqual discountAmount 0)}} <tr> <td colspan="5" align="right">Discount Amount</td> <td align="right">{{discountAmount}}</td> </tr> {{/if}}
Code:<tr x-if="{{notEqual discountAmount 0}}"> <td colspan="5" align="right">Discount Amount</td> <td align="right">{{discountAmount}}</td> </tr>
Please help.
Thanks in advance...Tags: None

Leave a comment: