Solved

Placed Order / Ordered Product stopped working (WooCommerce)

  • 20 April 2021
  • 6 replies
  • 152 views

Badge

Hi 👋 

I have used Klaviyo for about one year and it’s been super smooth!

 

But today I received a message saying that the WooCommerce synch had stopped working. I’ve not made any changes at all to the website and cannot seem to fix the issue (tried this and this without success).

 

It is forcing me to turn off a lot of flows (abandoned cart, welcome, browse abandonment) because they trigger or filter based on purchases made. It’s causing some stress 🤦‍♂️

 

Any suggestions on how to get this fixed and has anyone experienced the same?

 

Thank you for a wonderful community!

- Rob  

icon

Best answer by nate-klaviyo 20 April 2021, 22:22

View original

6 replies

Badge

Now we’re cookin’

 

 You saved the day Nate! Thank you very much for your support on this!

Hey Rob @Green Unicorn Farms!

Have you updated or added any theme/styling plugins recently to your store by any chance? It looks like there is some HTML being added to the responses from your store’s API, likely from another WordPress plugin.

 

The integration code is expecting the response to be in JSON format, so when it tries to parse the response, an error is thrown. You can see what this looks like using the below URL (swapping out ‘redacted’ for the consumer key and secret you use for the integration):

 

https://greenunicornfarms.com/wp-json/wc/v3/products?consumer_key=redacted&consumer_secret=redacted

 

You’ll see a bit of HTML at the top of the response that looks like this:

<link rel="stylesheet" id="wd-section-title-css" href="https://greenunicornfarms.com/wp-content/themes/woodmart/css/parts/el-section-title.min.css?ver=6.0.3" type="text/css" media="all" /> 			{"id":26624,"name": ...

 

Cheers,

Nate

Badge

Thank you very much for checking Nate!

 

That is super strange - It seems to come from a theme update (https://woodmart.xtemos.com/) that adds a weird stylesheet there for some reason.

 

I have reached out to theme support to see if they can assist ( 🙏) and if not I’ll have to get creative.

 

Thank you for pointing me in the right direction!!

- Rob

Badge

**Quick update if someone runs into the same issue**

I could remove the HTML by adding a snippet to the functions.php in my child-theme.

function woodmart_enqueue_inline_style( $key ) {

if ( function_exists( 'wc' ) && wc()->is_rest_api_request() ) {

return;

}

WOODMART_Registry()->pagecssfiles->enqueue_inline_style( $key );

}

Obviously only works for the Woodmart theme and you should only try it if you are comfortable working in the code.

 

Thank you again Nate!

Badge

Actually I take that back… I could make the JSON format work but it’s still not recording Placed Order and Ordered Product.

 

Would you mind having another look at the /wp-json/wc/v3/products?consumer_key=r… for me?

 

Actually I take that back… I could make the JSON format work but it’s still not recording Placed Order and Ordered Product.

 

Would you mind having another look at the /wp-json/wc/v3/products?consumer_key=r… for me?

 

It looks like the syncs/webhooks were still marked as failed - I just restarted them and queued up a backfill task for you to pull in any orders recorded in the last 7 days, so you should be all caught up. Can you take another look?

Reply