Skip to main content
Solved

How can i show (or not) compare at price?


Forum|alt.badge.img+2
  • Contributor I

Hello, 

 

I trying to do a conditional sentence inside a text block for show or not compare_at_price depending if item has or not discount on feed. But after add following code to text block i can’t save content and doesnt work.

Is for Shopify store.

Code:

{{ item.title }}
{% if item.price < item.compare_at_price %}
{% currency_format item.price %} {% currency_format item.compare_at_price %}
{% else %}
{% currency_format item.price %}
{% endif %}

 

Can anyone help me?

 

Thanks a lot, Kae

Best answer by sourabh

Hey @Kae

Could you provide some more information about where you are trying to implement the code? If it is in a flow or a campaign. 

I am assuming that you are trying to add the above piece of code in one of your flow emails. If that is the case, could you at least tell me what metric is being used to trigger the flow or what flow it is and I will be able to guide you through it properly. 
 

View original
Did this topic or the replies in the thread help you find an answer to your question?

3 replies

stephen.trumble
Community Manager
Forum|alt.badge.img+60

Hey @Kae 

Thank you so much for coming to the Klaviyo Community to get with with your syntax for your email template.

@Mailbox Manny Would you happen to know why this isnt working for Kae?


Mailbox Manny
Partner - Silver
Forum|alt.badge.img+38
  • Partner - Silver
  • 417 replies
  • January 15, 2022

@Kae Sorry, I’m late here.  Did you find a solution for this? 


sourabh
Partner
Forum|alt.badge.img+9
  • Partner
  • 17 replies
  • Answer
  • January 19, 2022

Hey @Kae

Could you provide some more information about where you are trying to implement the code? If it is in a flow or a campaign. 

I am assuming that you are trying to add the above piece of code in one of your flow emails. If that is the case, could you at least tell me what metric is being used to trigger the flow or what flow it is and I will be able to guide you through it properly.