Skip to main content
Contributor I
March 24, 2022
Solved

If-Else for Discounts

  • March 24, 2022
  • 1 reply
  • 304 views

Hi there! I’m working on moving our order confirmation emails from Shopify to Klaviyo. I’d like to include discount $ amounts if the customer had a discounted order. But if they didn’t, I want to leave the line blank so they don’t feel bad about seeing Discount: $0.00 

😊

Is there a way to do an if-else statement that can tell if the discount field is greater than 0? Or another way to make this work?

Thanks!

    This topic has been closed for replies.
    Best answer by Dov

    Hi @HaleyStuga,

    Thanks for sharing your question with us.

    Give this a try: 

    {% if event|lookup:'Total Discounts' != "0.00"} ${{ event|lookup:'Total Discounts' }} {% endif %}

     

    1 reply

    Dov
    DovAnswer
    Klaviyo Alum
    March 25, 2022

    Hi @HaleyStuga,

    Thanks for sharing your question with us.

    Give this a try: 

    {% if event|lookup:'Total Discounts' != "0.00"} ${{ event|lookup:'Total Discounts' }} {% endif %}

     

    DD