Show Discounted Line Item Price? (Shopify Order Confirmation with Dynamic Table)

  • 29 October 2020
  • 4 replies

Badge +2

How do you display a discounted line item price in a dynamic table for Shopify order confirmations?

I’ve followed this article’s instructions, but found that the line item price is displayed as the actual price of the item, so it doesn’t take into account if our sales agents discount an item. Our totals at the bottom of the confirmation are correct, but it’s confusing for customers when they don’t see the actual discounted line item price in the dynamic table.

I’ve setup the data source for the row and have the following four columns. Is there a way to display the discounted price in the PRICE column? Or do I need to include a column that shows the discount amount, which gets calculated in the ITEM TOTAL column?


{{ item.product.title }}

${{ item.quantity|floatformat:0 }}

${{ item.price|floatformat:2 }}

${{ item.line_price|floatformat:2 }}


Best answer by cassy.lee 7 November 2020, 02:25

View original

4 replies

Userlevel 6
Badge +9

Hi @PRMjames

Thanks for the great question, and for being a part of the Klaviyo Community forum!

If this is a confirmation email in Klaviyo, you could include this event variable in PRICE, or add it as it’s own Discount column.

{{ event|lookup:'Total Discounts' }}

This code will display the total discount for the entire order.

Additionally, “discounted item prices” can vary based on how you have the data structured, and you would need to find the correct variable within the Placed Order metric by using the directions found in the How to Find Event Variables section of this article.

Hope this is helpful!

Badge +2

Thanks @cassy.lee 

I’ve attempted to put {{ event|lookup:’Total Discounts’ }} in a couple places, but get an error: “The ‘lookup’ filter requires 2 arguments, but 1 was given.”

When you mentioned “how you have the data structured”, I have no idea. I just followed the instructions in the linked article.

Userlevel 6
Badge +9

Hi @PRMjames

Can you try using 

{{ event|lookup:'Total Discounts' }}

without copy + pasting. I think what might be happening, if I am seeing this correctly, is that your code above using incorrect syntax. You should be using the single quotation - I think what happened above is that I pasted in the incorrect syntax of the code.


Notice how this code snippet: 

{{ event|lookup:‘Total Discounts’ }}

has a different single quotation from this code snippet: 

{{ event|lookup:'Total Discounts' }}

Please copy and paste the latter one, which should pull up the correct total discount value for you. 



Badge +1

Hi, I am trying to show the total discount amount on my order confirmation email & I am getting a text that says ‘none’ but I can see that the customer used a discount code.