Solved

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

  • 4 January 2022
  • 3 replies
  • 534 views

Badge +2
  • Contributor I
  • 0 replies

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

icon

Best answer by sourabh 19 January 2022, 23:52

View original

3 replies

Userlevel 7
Badge +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?

Userlevel 7
Badge +38

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

Userlevel 2
Badge +9

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. 
 

Reply