GabiJ
GabiJ

Reputation: 95

Wordpress WooCommerce Checkout - SyntaxError: Unexpected token < in JSON at position 0

One of our Wordpress sites is facing an issue on the checkout page of WooCommerce. When "Place Order" button is clicked an error triggers:

SyntaxError: Unexpected token < in JSON at position 0

This is the error that is shown in the console:

<br />
<b>Fatal error</b>:  Call to a member function update_status() on 
boolean in <b>/home/public_html/wp-
content/plugins/woocommerce/includes/gateways/bacs/class-wc-gateway-
bacs.php</b> on line <b>346</b><br />

Any thoughts?

Upvotes: 1

Views: 10112

Answers (2)

Mayur
Mayur

Reputation: 1

I came across same issue for me it was folder permission issue which solved.

Upvotes: 0

GabiJ
GabiJ

Reputation: 95

After debugging the code, I figured out that my problem was somewhere in the database, with the ID of the order that wasn't saved properly (The value passed was always 0). My guess is that some plugin messed up my database.

The auto-increment was off in my database, so the ID of the order couldn't be saved correctly, thus resulting the above error mentioned in the 1st post.

The solution was to fix the database, by adding auto-increment where it was needed and delete all the entries with 0 as ID in table wp_posts.

Upvotes: 3

Related Questions