Solved

WooCommerce item price with tax

  • 15 July 2022
  • 8 replies
  • 542 views

Badge +3

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. 

 

 

icon

Best answer by Dov 15 July 2022, 16:53

View original

8 replies

Userlevel 7
Badge +61

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.

Badge +3

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

 

 

Userlevel 7
Badge +61

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.

Badge +3

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. 

 

Badge +2

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

 

Userlevel 7
Badge +61

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.

Badge +2

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

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: 

 

Reply