How to hide discount amount in the PDF Template if it is equal to zero?

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Triggerz
    replied
    Hi yuri, thank you so much. That actually worked

    Leave a comment:


  • yuri
    replied
    I think you need {{discountAmount_RAW}}, as the {{discountAmount}} prints a string with a zero which is not resolved to false.

    Leave a comment:


  • Triggerz
    replied
    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:


  • yuri
    replied
    Hi,

    Did you try:


    Code:
    x-if="{{discountAmount}}"

    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
    Code:
    {{#if (notEqual discountAmount 0)}}
       <tr>
          <td colspan="5" align="right">Discount Amount</td>
          <td align="right">{{discountAmount}}</td>
       </tr>
    {{/if}}
    ​
    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:
     <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...
Working...