3

I am developing an eCommerce website in Wordpress, and installed WooCommerce plugin, but on checkout I am facing this error

SyntaxError: Unexpected token < in JSON at position 0

When I checked the console there was this message

Unable to fix malformed JSON checkout.min.js

Due to those errors I am unable to proceed for checkout.

Dimitar
  • 4,402
  • 4
  • 31
  • 47
Umair Mehmood
  • 514
  • 1
  • 11
  • 24
  • 1
    You might be receiving HTML/XML from the server, instead of JSON, and that's why getting the parsing error. – Dimitar Dec 27 '17 at 15:00
  • Possible duplicate of ["SyntaxError: Unexpected token < in JSON at position 0" in React App](https://stackoverflow.com/questions/37280274/syntaxerror-unexpected-token-in-json-at-position-0-in-react-app) – Dimitar Dec 27 '17 at 15:00
  • Learn to use your developer console (specifically the network tab), and see what the response is. I'm guessing this is in response to an AJAX call, and it's possible the AJAX call is not working as intended. – random_user_name Dec 27 '17 at 15:48

1 Answers1

0

I had a similar type of issue and chrome console pointed toward checkout.min.js that is core file of woocommerce which is responsible for all checkout tasks but issue was not in that file it is somewhere else and we have to find that

what you can do about that is deactivate all the plugins except woocommerce plugin and then try if it works fine then you are good to go for next step and that is activating each plugin and testing after that

This method could take a long time if you have many plugins but you can group plugins like first 5 and deactivate them first and try if everything runs fine then next 5 and so on

you will find a culprit plugin. which may have hacking code or some events are calling on checkout In my case, there was a plugin called as Akismet3 which was full of hacking code

AHSAN KHAN
  • 426
  • 7
  • 17