Skip to main content
Contributor I
September 15, 2022
Solved

Add Discount and Original price in flow

  • September 15, 2022
  • 6 replies
  • 1718 views

Does anyone know how to put two prices in my email template product block.
Like if I want to add the original price and the discounted price and it should be automated with the website prices.

Best answer by alex.hong

Hi @alimah,

Welcome to the Community,

If you are trying to show full price and discounted price in a dynamic table block in abandoned cart flow, you'd click into the dynamic table block's source and add this coding:

{% if item.compare_at_price %}<s>{% currency_format item.compare_at_price|floatformat:2 %}</s>{% else %} {% endif %} Price: {% currency_format item.line_price|floatformat:2 %}

 
To get to the "source" of a dynamic table:
?name=Screen+Shot+2022-03-24+at+8.55.16+AM.png
Where to paste the coding:
?name=Screen+Shot+2022-03-24+at+8.57.05+AM.png
Preview of event:
?name=Screen+Shot+2022-03-24+at+8.58.31+AM.png
 
If you need this in a Browse Abandon flow, the coding for the source of the dynamic block would be:

<p>Price: {{ event.Price|striptags }}{% if event.CompareAtPrice != '$0.00' %} <s>{{ event.CompareAtPrice }}</s> {% else %}{% endif %}</p>

 
If you were trying to have this show in the Product Block (that pulls from the catalog/product feed), sadly this is not available at this time. 
 

6 replies

alex.hong
alex.hongAnswer
Klaviyo Alum
September 15, 2022

Hi @alimah,

Welcome to the Community,

If you are trying to show full price and discounted price in a dynamic table block in abandoned cart flow, you'd click into the dynamic table block's source and add this coding:

{% if item.compare_at_price %}<s>{% currency_format item.compare_at_price|floatformat:2 %}</s>{% else %} {% endif %} Price: {% currency_format item.line_price|floatformat:2 %}

 
To get to the "source" of a dynamic table:
?name=Screen+Shot+2022-03-24+at+8.55.16+AM.png
Where to paste the coding:
?name=Screen+Shot+2022-03-24+at+8.57.05+AM.png
Preview of event:
?name=Screen+Shot+2022-03-24+at+8.58.31+AM.png
 
If you need this in a Browse Abandon flow, the coding for the source of the dynamic block would be:

<p>Price: {{ event.Price|striptags }}{% if event.CompareAtPrice != '$0.00' %} <s>{{ event.CompareAtPrice }}</s> {% else %}{% endif %}</p>

 
If you were trying to have this show in the Product Block (that pulls from the catalog/product feed), sadly this is not available at this time. 
 

Contributor II
August 13, 2023

Hello! Thank you for your response @alex.hong

This solution definitely works for the items that have a discounted price, but not for the items with original price. So if the CompareAtPrice is $0.00, meaning that the item is full price, how to set up a logic in a way that it shows one price only? Can we add more conditions?
Thank you!

 

JimmyRittenborg
Partner
Partner
September 13, 2023

When selling in multiple currencies at Shopify, it’s nearly impossible to detect if Compare-at-price is relevant for the product - But I’ve made a Automated Collection in Shopify which collects all my products with a Compare at price greater than 1 and my store is only in two languages, so that way I can just listen for if the product is present in this Sales Collection and then in that case show the compare-at -price:

{% if "Sale" in event.Categories or "Tilbud" in event.Categories %}
<br /><span style="color: #b7b8b9; text-decoration: line-through;">{{ event.CompareAtPrice|striptags }}</span>
{% endif %}
Contributor I
February 26, 2025

@alex.hong  Do you know what code would work to display the original price vs discounted price in an Order Confirmation flow?

Contributor I
June 12, 2026

How to fetch these values in klaviyo

subtotal, Shipping, tax, Total

I tried lot of way but didnt work, please share anyone have dynamic placeholders

Contributor I
June 15, 2026