• Resolved sachristan

    (@sachristan)


    This doesn’t seem to work at all, we still get daily people with multiple orders after they have received a SyntaxError: Unexpected Token.

    Posted solution below:

    If you see this during checkout for example, it means that a plugin or theme is throwing a notice during the ajax post and breaking the response.

    To find out which plugin is doing this, view your sever error logs and look for notices. Your host may be able to help you look for this log if you cannot locate it.

    To prevent plugins and themes from outputting notices entirely, ensure debug mode is off in your wp-config file:

    define(‘WP_DEBUG’, false);
    error_reporting(0);
    @ini_set(‘display_errors’, 0);

    Can someone point us in the right direction we have customers who are sending in duplicate orders after their initial order has been accepted.

    Thanks

    https://www.ads-software.com/plugins/woocommerce/

Viewing 5 replies - 46 through 50 (of 50 total)
  • raviraj

    (@raviraj)

    Mike, What is the solution if gateway returns response via XML instead of JSON? Did it still giving syntax error if response is in XML?

    Thread Starter sachristan

    (@sachristan)

    We had to hire a PHP developer to fix this issue. If anyone needs a contact let me know.

    boxcandy

    (@boxcandy)

    I had this issue, it seemed to happen out of the blue one day. I disabled the following 3rd party plugins and the issue went away (not sure which one was the actual culprit):

    – WooCommerce Abandon Cart Lite Plugin
    – Basket Recovery

    Hope this helps somebody.

    Ideas and Pixels

    (@ideas-and-pixels)

    My god, what’s with this Mike Jolley guy? He alone makes me never want to use WooCommerce again. I hate when developers break things (even if they thought they were “fixing” them), then refuse to shoulder any blame. You, sir, are giving your organization a terrible name. While your answers are valid, they are not compassionate in the slightest. You seem to have no care that we’re having these issues.

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Thanks for the personal attack Ideas and Pixels. I spend a lot of my free time replying to users and contributing to OS, so I appreciate you saying I don’t care. Where is your contribution?

    As much as I’d love to, this isn’t something that can just be ‘fixed’ easily in core – its down to a misuse of the API and can be rectified by the author of the gateway. So please get in touch with them before coming here and pointing more blame. Thats not helpful to you, not good for developers, and its not helpful to other users of that gateway.

    As an aside, we’re actively trying to improve documentation so future projects can follow guidelines without implementing possibly-breaking code, and we’ve commented prior on improving beta testing procedures, which you’re free to join too I might add.

    I’m going to ping a mod to close this issue since these replies are against the forum rules. If anyone has an issue like posted, narrow the cause, contact the dev, and if that fails post a details new thread naming the extension for advice. If its open-source it can be looked at, if its paid it cannot.

Viewing 5 replies - 46 through 50 (of 50 total)
  • The topic ‘Common Issue – SyntaxError: Unexpected Token’ is closed to new replies.