Solved

Add Discount and Original price in flow

  • 15 September 2022
  • 3 replies
  • 779 views

Badge +1

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.

icon

Best answer by alex.hong 15 September 2022, 21:56

View original

3 replies

Userlevel 7
Badge +58

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. 
 

Badge +1

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!

 

Badge +3

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 %}

Reply