Skip to main content
Solved

Add multiple prices to a subtotal


Forum|alt.badge.img+2
  • Problem Solver I
  • 8 replies

Hi there,

I want to show a subtotal of all line items in my order email.
Unfortunately the WooCommerce event data doesn’t include that.

My idea is to loop through every item in the order and add the prices to a subtotal.
Is that possible?

I saw, that there are “For blocks”. Can I use them for my idea?

Best answer by Omar

@SimonK the answer is that it depends, it always depends.

If you have a developer on your end the easiest way is to make sure you add this data in the event or create a new event that has all the data you're looking for. 

Not sure which event data you're currently referencing but either way having the data you need to use in the emails included in the event is the best solution to solve that problem.

Some examples here: Added to cart or placed order

 

Hope it helps.

 

Regards,

Omar

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

4 replies

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

Hi @SimonK,

At this time, WooCommerce only sends us the subtotal price for a single product, but not the total subtotal price of all products combined. Subtotal across all items would need to be a data point that we can reference from the WooCommerce’s event metadata in order to make this work reliably. “For” blocks will allow you to display, say the items in the basket with their respective quantities but it won’t add everything together.

I hope that’s helpful and thanks for being a member of our community.


Forum|alt.badge.img+2
  • Author
  • Problem Solver I
  • 8 replies
  • May 9, 2022

Hi @Dov,

thank you for your answer.

So there is no way to show subtotals in an order email?


Omar
Partner - Platinum
Forum|alt.badge.img+46
  • 2025 Champion
  • 494 replies
  • Answer
  • May 9, 2022

@SimonK the answer is that it depends, it always depends.

If you have a developer on your end the easiest way is to make sure you add this data in the event or create a new event that has all the data you're looking for. 

Not sure which event data you're currently referencing but either way having the data you need to use in the emails included in the event is the best solution to solve that problem.

Some examples here: Added to cart or placed order

 

Hope it helps.

 

Regards,

Omar


Forum|alt.badge.img+2
  • Author
  • Problem Solver I
  • 8 replies
  • May 10, 2022

Thank you @Omar 

I will take a look at your links. Maybe there is a way to solve this.

Is it possible to add these JS Code in addition to the WooCommerce integration?