Skip to main content
Solved

Woocommerce - add order data to 'placed order'


Forum|alt.badge.img+3

Hi all

 

For some reason Woocommerce and Klaviyo do not have the checkout ‘subtotal’ figure coming over.

Is there a way I can add this? 

The subtotal is the total basket excluding delivery and tax.

Best answer by Dov

Hello @SDBradfo,

Thank you for sharing your question with the Klaviyo Community.

You are absolutely correct, a subtotal tag is not included in the WooCommerce event data, only the total as a whole, which includes tax and uses the following tag: {{ event| lookup ‘$value’ }}.This is the tag to use for now because there is no way to modify existing events i.e. Placed Order or the event’s data i.e. subtotal, in Klaviyo. With that said, I will submit a feature request to see if we can include subtotal in the WooCommerce event data in the future. 

As an alternative solution, you can send us a custom event using the Track API including the subtotal amount in the event. If you decide to pursue this solution, I recommend using our API reference guide. If you’d like assistance with this solution, I recommend looking into finding a Klaviyo partner, you can find more details on this process and the benefits of pursuing a Klaviyo partner in the post below:

https://community.klaviyo.com/job-board-55/tips-for-hiring-a-klaviyo-partner-770

 Thanks and have a great day.

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

10 replies

Dov
Forum|alt.badge.img+61
  • Klaviyo Alum
  • 1493 replies
  • Answer
  • May 17, 2021

Hello @SDBradfo,

Thank you for sharing your question with the Klaviyo Community.

You are absolutely correct, a subtotal tag is not included in the WooCommerce event data, only the total as a whole, which includes tax and uses the following tag: {{ event| lookup ‘$value’ }}.This is the tag to use for now because there is no way to modify existing events i.e. Placed Order or the event’s data i.e. subtotal, in Klaviyo. With that said, I will submit a feature request to see if we can include subtotal in the WooCommerce event data in the future. 

As an alternative solution, you can send us a custom event using the Track API including the subtotal amount in the event. If you decide to pursue this solution, I recommend using our API reference guide. If you’d like assistance with this solution, I recommend looking into finding a Klaviyo partner, you can find more details on this process and the benefits of pursuing a Klaviyo partner in the post below:

https://community.klaviyo.com/job-board-55/tips-for-hiring-a-klaviyo-partner-770

 Thanks and have a great day.


Forum|alt.badge.img+3
  • Author
  • Problem Solver I
  • 7 replies
  • May 18, 2021

Thanks. I am hoping this becomes a core part of the Ordered Product event data. It seems like a very big oversight on Klaviyo’s part since you’d never receive an order confirmation email in the UK without a subtotal (before VAT). 


Forum|alt.badge.img+6
  • Active Contributor II
  • 19 replies
  • January 31, 2022

I have the same issue. I am using WordPress and woo-commerce and have installed the official Klavio pug in. I understand that the standard set up does not import the subtotal for the order when we have multiple products. I see from the above post that you are referring to an api. How to I achieve this please.


Forum|alt.badge.img+3
  • Active Contributor I
  • 11 replies
  • June 27, 2022

Please add me to the people that think this should be standard for klaviyo WooCommerce integration.


stephen.trumble
Community Manager
Forum|alt.badge.img+60

Hey @Wolfgang 

I will definitely roll this up to our product team on your behalf! Thank you for sharing the feedback, we truly appreciate it!


Forum|alt.badge.img+3
  • Active Contributor I
  • 11 replies
  • June 30, 2022

Hi,

Until the klaviyo product team gets this implemented I have developed a workaround that works for me as an interim solution. (It doesn't allow me to format the subtotal with thousand separators like I prefer.)

The calculation we use to determine the SUBTOTAL:

SUBTOTAL = Total - TotalShipping - TotalTax - Discount
 

${% with val1=event.extra.TotalShipping|multiply:-1 val2=event.extra.TotalTax|multiply:-1 val3=event.extra.TotalDiscount %}{{ event|lookup:'$value'|floatadd:val1|floatadd:val2|floatadd:val3|floatformat:2 }}{% endwith %}

I hope this helps for the moment.

 


Forum|alt.badge.img+6
  • Problem Solver I
  • 19 replies
  • August 18, 2022

Thanks for this @Wolfgang, this is brilliant!


Forum|alt.badge.img+3

@Wolfgang I appreciate it a lot! This is def. amazing!


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

Hi,

4 months ago I provided a workaround to getting the SUBTOTAL. The updated code below changes floatformat:2 to floatformat:”2g” which adds formatting with thousand separators that was missing before.

${% with val1=event.extra.TotalShipping|multiply:-1 val2=event.extra.TotalTax|multiply:-1 val3=event.extra.TotalDiscount %}{{ event|lookup:'$value'|floatadd:val1|floatadd:val2|floatadd:val3|floatformat:"2g" }}{% endwith %}

David To
Klaviyo Employee
Forum|alt.badge.img+60
  • Klaviyo Employee
  • 2456 replies
  • November 18, 2022

Hey @Wolfgang,

Really appreciate you sharing your solutions! 

I’m sure your codes will help a lot of other Community members wondering the same thing!

Thanks for being a part of our Klaviyo Community!

David