Skip to main content
Solved

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

  • October 29, 2020
  • 4 replies
  • 1906 views

Forum|alt.badge.img+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
{{ item.product.title }}

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

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


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

Best answer by cassy.lee

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. 

 

Thanks, 
-Cassy

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

4 replies

cassy.lee
Forum|alt.badge.img+9
  • Klaviyo Alum
  • 271 replies
  • October 29, 2020

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!
-Cassy


Forum|alt.badge.img+2
  • Author
  • Contributor I
  • 1 reply
  • November 6, 2020

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.


cassy.lee
Forum|alt.badge.img+9
  • Klaviyo Alum
  • 271 replies
  • Answer
  • November 7, 2020

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. 

 

Thanks, 
-Cassy


Forum|alt.badge.img+1
  • Contributor I
  • 1 reply
  • April 21, 2021

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.