Skip to main content
Solved

WooCommerce item price with tax


Forum|alt.badge.img+4
  • Contributor I
  • 6 replies

Hi,

I have dynamic blocks in a flow email for transactional emails. However the product price only shows  without tax, I want it to show with Tax. How can i change this? I cannot see this in the array.

 

Total: {% currency_format item.LineTotal|floatformat:2 %}

 

only on the bottom, it shows as a total for all items. 

 

 

Best answer by Dov

Hi @SK789,

Thanks for sharing this question with us.

Since WooCommerce does not send over the line item price with tax included in the event data for Placed Order, this will have to be added to your email in different lines. You can do something like this to display the line total + the tax amount:

Total: ${{ item.LineTotal|floatformat:2 }}

Tax: ${{ item.LineTotalTax|floatformat:2 }}

Alternatively, you can use: 

Total: ${{ event|lookup:'$value' }}

to pull the full value of the cart.

I hope that’s helpful.

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

8 replies

Dov
Forum|alt.badge.img+61
  • Klaviyo Alum
  • 1493 replies
  • Answer
  • July 15, 2022

Hi @SK789,

Thanks for sharing this question with us.

Since WooCommerce does not send over the line item price with tax included in the event data for Placed Order, this will have to be added to your email in different lines. You can do something like this to display the line total + the tax amount:

Total: ${{ item.LineTotal|floatformat:2 }}

Tax: ${{ item.LineTotalTax|floatformat:2 }}

Alternatively, you can use: 

Total: ${{ event|lookup:'$value' }}

to pull the full value of the cart.

I hope that’s helpful.


Forum|alt.badge.img+4
  • Author
  • Contributor I
  • 6 replies
  • July 15, 2022

Hi 

Thanks for coming back.

How comes this works fine with abandon cart? - 

{{ item.Name }}

Quantity:{{ item.Quantity|floatformat:0 }}

Price: {% currency_format item.TotalWithTax|floatformat:2 %}

 

 


Dov
Forum|alt.badge.img+61
  • Klaviyo Alum
  • 1493 replies
  • July 15, 2022

Hi @SK789,

Thanks for your reply.

This is because the Started Checkout event from WooCommerce contains TotalWithTax while the Placed Order event does not. Thus we have to use the separate line total + line tax as a substitute.

I hope that’s helpful.


Forum|alt.badge.img+4
  • Author
  • Contributor I
  • 6 replies
  • July 15, 2022

ok - this makes it quite difficult to use Klaviyo then - as the events in WooCommerce own Order completion has product prices with tax 

as the arrays you have provided only shows 

total without tax

tax

third line should be with tax - would you know what that would be?

 

Is there any way Klaviyo can have these built for WooCommerce customers, as I can see for shopify this has been done. Would make it so much easier. 

 


Forum|alt.badge.img+3
  • Contributor I
  • 2 replies
  • November 18, 2022

Hi, 

Is it possible to sum up this too events in order to have the item price with tax ?

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

Item tax: ${{ item.LineTotalTax|floatformat:2 }}

Because the explanation above you give the cart total but I need the item total.

Thanks, 

Regina Costa

 


Dov
Forum|alt.badge.img+61
  • Klaviyo Alum
  • 1493 replies
  • November 18, 2022

Hi @reginacosta,

Thanks for your note.

You can try using the “add” tag: 

|add

to build a statement to total the values- so something like:

{% with tax=item.LineTotalTax total=item.LineTotal %} {{ total|add:tax }} {% endwith %}

I hope that helps.


Forum|alt.badge.img+3
  • Contributor I
  • 2 replies
  • November 18, 2022

Hi, 

Thank you so much for your quick feedback!

I’ve tried now but unfortunately it gives me an error message as you can see bellow. 

Is there other way to do it?

Best, 

Regina Costa


Forum|alt.badge.img
  • Contributor I
  • 1 reply
  • January 12, 2024

Hello, I’m also interested in a solution for the line items including tax for WooCommerce. Are there some new informations?

 

Found the solution here: