How to fix error SyntaxError Unexpected end of input OK when editing order in OpenCart 2

February 1, 2015 - By 
order_change_error_in_opencart_2

Recent days I have encountered many reports about the error SyntaxError: Unexpected end of input OK when editing order in OpenCart 2. The error looks like as image below:

order_change_error_in_opencart_2

 

In this post, I will show how to fix that probllem. You can follow steps below:

1. Disable the Maintenance Mode in admin > System > Stores > Your store > tab Server.

2. Go to Admin > System > Users > API > Create new API account.

api_account_creating

3. Go to Admin > System > Settings > Edit your store > Select tab Option > Checkout section > set API User to the created account.

api_admin_setting

4. Try to edit order again, you will see the problem is fixed.

NOTE THAT: In some specific hostings, they cause this problem too. If you follow the steps above, the problem still occurs, you can contact me via the Contact Page. I will help you to fix it.

  • Washington

    Did all that procedure, but still has the same error. I do not know what to do.

  • http://xeaon.de/ Kemal

    Hi, sry but i’ve followed your steps without any success. I’ve also debugged the code and it seems like the API itself has some issues. I’m getting HTTP 200 responses but except the poor headers, there is no content in the response.

    • viethemes

      Hi, Could you provide your site url, a admin account and a FTP account to email viethemes@gmail.com, so I can take a look at the problem closer?

      • http://xeaon.de/ Kemal

        Sorry but ofc not :-)

  • yowchuan

    Great tips! I followed your instructions and managed to update the order. However, there’s still a bug in the process and it only happens when I checked the ‘Notify Customer’ check box.

    There’ll be a warning pop-up that appears when I submit the update:
    SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

    However, the status is still updated to the system. I am just thinking how I could get rid of the annoying pop-up once and for all.

    • viethemes

      Hi, Could you provide your site url, a admin account and a FTP account to email viethemes@gmail.com, so I can take a look at the problem closer?

  • Vex Computers

    Here is the answer I got from Heart internet:

    …………………………………………

    Thanks for contacting us.

    This looks to be caused by the fact that open cart are now attempting to create loopback connections which are not support on the shared platform.

    Loopback connections are blocked for a good reason on shared hosting (used incorrectly or maliciously it could take down the server) and many shared hosting companies do the same thing. So if OpenCart now require this on their very latest version then they’re going to encounter a lot of people with non-functioning OpenCart sites, therefore I’ll assume they’ll release a work around or update.

    ………………………………………………

    any workaround or do we just have to wait for open cart to patch the problem?

    • viethemes

      You should contact to your server provider and try to upgrade to high package.

      • Vex Computers

        I have a dedicated server with VPS.net and it still has the same problem.

        • viethemes

          Could you send your site url, a admin account and a FTP to email viethemes@gmail, so I can take a look at the problem closer?

  • њαs̲s̲Θиץ

    I do your steps but same problem no luck

    • viethemes

      Could you send your site url, a admin account and a FTP to my email viethemes@gmail, so I can take a look at the problem closer?

  • Sami

    GREAAAATTTTT MAN… THANKS A LOT….. :)

  • Nasrin Zoghbia

    I followed the steps but I am still having the same issue. I think this is why I am loosing sales on my site.

    • viethemes

      Could you provide your site URL, a admin account and a FTP account to my email viethemes@gmail.com so I can take a look at the problem closer?

  • Donny.Paul.1972

    I get this error when a customer trys to register, don’t know if its related.. seams to me Opencart 2 although it looks nicer, is not all that well written. :( which is a shame as ive been a huge fan until now.

  • Alessandro Tuveri

    HI on my case, where I have configured APIs for administrator, checkout, fill the checkboxes to ensure privileges on modifications, configured the shop, etc. nothing worked.
    Inspecting config.php
    I discovered that the CONSTANT
    HTTPS_CATALOG was not used (my O.C. was an update from 1.5.4.x to 0.C. 2.0.2.x)
    adding the constant magically all works fine now!
    Sad thing: nobody (O.C. forum, github) was helping me….

  • http://labore.vn/ Chikaki Rikino

    I do your steps but same problem no luck?

    • viethemes

      Hi,
      Could you send a admin account and a FTP account to email viethemes@gmail.com, so I can take a look at the problem closer?

      • http://labore.vn/ Chikaki Rikino

        I try, but no working…

  • cj

    thanks, although i have found this solution on opencart forum I was unsure what the username should be. Your page was so helpful, i realised straight away it had the be the username I was using to log in with. it fixed the issue on my live version but oddly enogh not on my local server. its usually around the other way for problems.

    it seems if I have more than one admin account that this won’t be a problem either

  • Linh Nguyen

    I tried the steps above as well and it didn’t work. Can I send you details of my account for you to help troubleshoot? Than you so much

    • viethemes

      Hi,
      Could you send a admin account and a FTP account to email viethemes@gmail.com, so I can take a look at the problem closer?

      Best Regards,
      viethemes.

  • priyank

    hello guys
    its too small issue
    i can solve this issue …..
    mail me if any error in open cart just mail me i can solve it within 48 hour :)

  • dgytg

    gjhjh

  • dgytg

    jkjgkhjkj

  • Alessio Colavecchi

    I have try to fix the problem but persiste can you help me please?

    • viethemes

      Hi,
      Could you send a admin account and a FTP account to email viethemes@gmail.com, so I can take a look at the problem closer?

  • JY

    It might be because SSL is not installed in the server. One solution is to get a SSL certificate installed in the server of course. The other solution is just to use http instead of https. (just change the links in the config.php, less secure of course)

  • Kavendra Chauhan

    Thanx

  • http://wayanad.co.in Wayanad.co.in Admin

    Thank you sir!
    You are great..The fix worked well..
    Thanks again..

    • http://wayanad.co.in Wayanad.co.in Admin

      Once again I had the same problem today. I went to settings and it showed the user admin is already selected. Simply I clicked SAVE button..It worked! Now no such JSON error.
      Hope you too can try this if error persists.

  • http://www.tadreesonline.com TadreesOnline

    Hi, I try this method but issue not solved I am using Hostgator hosting

  • http://www.GarmentStudio.com/ GarmentStudio Sales Team

    i already have few API and its still same should i create new API for this?

  • Yohanes

    I got this error. But in checkout page when i’m trying to register new account. Could you help me.

  • Mariam

    hi.

    i have 2 sites running in opencart version 2.0.2.0 on the same server in different folders with almost same setting. in one site it is running perfectly. i can edit orders and delete them. but in other main site i cannot do that. i have tried many solutions that says create new user api. replace admin files with other site that is working perfeclty but cannot mae it work. its been 2 days and yet no solution. anyone please help me out.

    your help is greatly appreciated

  • Tauseef

    Hi, Even i am facing the same issue, I tried the steps above as well and it didn’t worked for me. shall I send you details of my account for you to help troubleshoot? Thank you..

  • Baskar Rao

    Hi, i recently upgraded from OC 2.0.1.1 to OC 2.0.3.1 with Journal theme, i am getting SyntaxError: JSON.parse: unexpected end of data at line 2 column 1 of the JSON data in my checkout page when i select an city , can you help me please http://screencast.com/t/QWxsgefke

  • nicole

    Thank you very much.The solution fully worked.You earned 100% points from me.

  • Opencartprogrammer

    Hi all,
    Finally we get the solution for the order edit error “SyntaxError:

    JSON … ok” in OpenCart 2.0.1.0, 2.0.1.1, 2.0.2.0, 2.0.3.1, 2.1.0.1,

    2.1.0.2, 2.2.0.0, 2.3.0.0, 2.3.0.1, 2.3.0.2 If you really want to get

    the solution for the order edit error in your OpenCart store then

    visit us and contact through GET A QUOTE message or place a support

    ticket by the links below respectively.

    http://opencartprogrammer.com/

    http://opencartprogrammer.com/helpdesk/

    Our support team will get back to you soon.

    thanks
    Opencartprogrammer team