OpenCart 2 error: SyntaxError Unexpected End of Input OK
We have noticed that some clients are experiencing an error when they try to edit orders on their websites. This looked quite strange, as there are no indications in the error logs for the cause.
After further investigation, we have discovered that the issue is causing troubles for a lot of OpenCart users. There are open issues on GitHub OpenCart Issue and StackOverflow OpenCart Issue that describe the error in details. Still, if you are experiencing such an error message as well, there is a way to fix that completely. Here is what you can try, in order to resolve the error message.
Disable Maintenance Mode
The first thing you need to consider is to disable maintenance mode on your website if you are using this feature. It may be causing the error message in question on your website so you can test that first. Simply log into the admin area of your website and locate the System option from the left-side menu. Then click on the Settings button.
Choose your store and click on the Edit button next to it.
Select the Server tab and scroll down to the Maintenance Mode option. Set it to No and Save the changes.
Remove Password Protection
If you have password-protection for your OpenCart installation, this may be causing the error message in question as well. It is important to remove the password protection on your website and test editing of the orders again.
Generate User API
If the above techniques do not work, there is a third cause for the error as well. Log into your OpenCart administrative area and locate the System option on the left-side menu. Select Users and then API.
Click on the Add New button to create a new API on your website. Edit the following two fields:
Username: Enter a long username with letters and numbers. It doesn’t have to make sense, but to be secured.
Password: Generate a password
Status: Set the status to Enabled.
When you are ready, click on the Save button to keep the changes.
After that, select the System tab from the main menu again and click on the Settings option. Select your store and click on the Edit button next to it. On the next page, select the Options tab and scroll down to the Checkout section. Select the user you have created above from the API User drop-down box.
The issue with the error message when editing orders on your OpenCart 2 website should now be fully resolved. Still, note that FastComet offers free 24/7 technical support assistance on each SSD OpenCart Hosting plans. If you are not able to fix the error yourself, you can always request assistance from our team via your FastComet Client Area.
The latest tips and news from the industry straight to your inbox!
Join 30,000+ subscribers for exclusive access to our monthly newsletter with insider cloud, hosting and WordPress tips!
Comments (6)
hello I cant import demo error popup:
“localhost says
error_input_not_found”
Hello Natia,
This error appears when one or more of the files which you are trying to import are either corrupted or not in the correct structure. However, we cannot provide you with an exact answer on which of the files was the culprit as we do not have the necessary information and access to your website’s configuration in order to determine that.
I am facing opencart order edit issue. I am getting error while I click edit option. the error message is “SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data”.
I am not hosting with you but ready to pay for the support. I did all changes mentioned above but issue is not fixed.
Regards,
Vijay
Hello Vijay,
One more thing which you can try is to check if the error is caused by a script fail after an incorrect configuration of your installation’s admin/config.php which breaks your session cookie. To do this, navigate to the admin/config.php and set this snippet as follows:
For HTTP
define(‘HTTP_SERVER’, ‘http://www.domain.com/admin/’);
define(‘HTTP_CATALOG’, ‘http://www.domain.com/’);
For HTTPS
define(‘HTTPS_SERVER’, ‘http://www.domain.com/admin/’);
define(‘HTTPS_CATALOG’, ‘http://www.domain.com/’);
Of course, change the “www.domain.com” with your actual domain name.
If you are still experiencing the issue afterwards, you should consider hiring a developer or seeking assistance in the official OpenCart forum. Furthermore, if you choose to switch your hosting and move to us, we will be able to check your case in much more detail and provide you with adequate support.
when a new user fills the registration form and after that clicks the submit button…syntax error appears saying that unexpected end of json inputOk…!! how to resolve this error..??
The issue can be caused by a custom modification on your website’s files
or an interfering plugin. Our guess is that there are some undefined values in your OpenCart’s catalog/controller/checkout/register.php file. Unfortunately, as I was unable to find you in our client list, our technical support team cannot be of your service.
Our advice in this case is to seek assistance from a developer or ask directly on OpenCart’s forum.