Skip to main content
Problem Solver I
May 5, 2022
Solved

Add multiple prices to a subtotal

  • May 5, 2022
  • 4 replies
  • 488 views

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?

    This topic has been closed for replies.
    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

    4 replies

    Dov
    Klaviyo Alum
    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.

    DD
    SimonKAuthor
    Problem Solver I
    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
    OmarAnswer
    2025 Champion
    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

    Helping E-commerce brands maximize Lifetime Value & Profits with Klaviyo, CRO & CVO - Get your free Audit - https://link.polarisgrowth.com/free-audit
    SimonKAuthor
    Problem Solver I
    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?