Post by Webbo » Tue Mar 31, 2015 7:01 pm

OC2.0.1.1
This appears to be a common problem, with no real resolution

Sales > Orders > Add / Edit > Next > SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
OK
Tried the following as per forum topics:
1. In Opencart Admin, go to Settings >> API and create a new user.
2. In cPanel navigate to phpMyAdmin and then select your database where your store is installed.
3. Find table oc_setting and then find key "config_api_id".
4. Set the value field to 1 where key = config_ap_id
5. Next go to table oc_api and check that api_id = 1

1. Site is NOT in maintenance mode.
2. mod_security is OFF

It appears to be a API problem, as I did create a new API, you could then edit, but not add.
After logging back in, error re-appeared

is there a way to remove or disable the API?

Please Please can anyone help
Last edited by Webbo on Wed Apr 01, 2015 5:26 am, edited 1 time in total.

New member

Posts

Joined
Sun Oct 10, 2010 12:31 am

Post by pm-netti » Tue Mar 31, 2015 7:09 pm

Webbo wrote:OC2.0.1.1
This appears to be a common problem, with no real resolution

Sales > Orders > Add / Edit > Next > SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
OK
Tried the following as per forum topics:
1. In Opencart Admin, go to Settings >> API and create a new user.
2. In cPanel navigate to phpMyAdmin and then select your database where your store is installed.
3. Find table oc_setting and then find key "config_api_id".
4. Set the value field to 1 where key = config_ap_id
5. Next go to table oc_api and check that api_id = 1

1. Site is NOT in maintenance mode.
2. mod_security is OFF

It appears to be a API problem, as I did create a new API, you could then edit, but not add.
After logging back in, error re-appeared

is there a way to remove or disable the API?

Please Please can anyone help
Is same issue also to english language? Or is language file incorrect?

User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä, Finland

Post by Webbo » Tue Mar 31, 2015 7:13 pm

The default language is English (no other languages set up)

code: en
locale: en_US.UTF-8,en_US,en-gb,english

New member

Posts

Joined
Sun Oct 10, 2010 12:31 am

Post by pm-netti » Tue Mar 31, 2015 8:54 pm

Webbo wrote:The default language is English (no other languages set up)

code: en
locale: en_US.UTF-8,en_US,en-gb,english
The three most common reason:
http://forum.opencart.com/viewtopic.php ... 20#p552335

User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä, Finland

Post by Webbo » Tue Mar 31, 2015 9:07 pm

I know, I read that too

This issue is 3 reasons (the most common first):
1. OpenCart 2.x install is not complete > it is complete, I also tested on clean install of 2.0.1.1 > same error
2. PHP is too old version > PHP Version 5.3.28
3. Server of Store is not support cUrl library. > the server can handle PHP cUrl

cURL support enabled
cURL Information 7.19.7

what is the next step?

can the API function be disabled?
is there an extension that fixes this bug?

New member

Posts

Joined
Sun Oct 10, 2010 12:31 am

Post by pm-netti » Tue Mar 31, 2015 9:13 pm

Webbo wrote: the server can handle PHP cUrl
How have you tested this?

User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä, Finland

Post by Qphoria » Tue Mar 31, 2015 10:53 pm

I'll chime in here because none of the "3 most common reasons" are worth anything.

The actual cause of this is the new API user requirement.
However, there is still some unanswered bits because for some upgrades it works and for others it doesn't at first.

1. Be sure you have an active API user in the System->Users->API menu in the admin.
2. Select an API user as a default in the System->Settings area on the "Option" tab.
3. Delete the cookies in your browser for the site.
4. Now log back into admin and try to Add/Edit an order and it should work.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Qphoria » Tue Mar 31, 2015 11:00 pm

pm-netti wrote:
Webbo wrote: the server can handle PHP cUrl
How have you tested this?
This is unnecessary, the installer checks this already and EVERY site has curl these days or they are out of business.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by pm-netti » Tue Mar 31, 2015 11:42 pm

Qphoria wrote:I'll chime in here because none of the "3 most common reasons" are worth anything.

The actual cause of this is the new API user requirement.
However, there is still some unanswered bits because for some upgrades it works and for others it doesn't at first.

1. Be sure you have an active API user in the System->Users->API menu in the admin.
2. Select an API user as a default in the System->Settings area on the "Option" tab.
3. Delete the cookies in your browser for the site.
4. Now log back into admin and try to Add/Edit an order and it should work.
Thanks. This all is part for `reason step 1`: OpenCart version 2.x install.

User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä, Finland

Post by pm-netti » Tue Mar 31, 2015 11:53 pm

Qphoria wrote: This is unnecessary, the installer checks this already and EVERY site has curl these days or they are out of business.
Who the Asker in this forum understand that? OpenCart does not clearly reflect "Your cURL is not work". Here it is not sufficient that the Curl is "Enabled".

User avatar
Active Member

Posts

Joined
Sat Apr 07, 2012 11:22 pm
Location - Kittilä, Finland

Post by Webbo » Wed Apr 01, 2015 4:44 am

The plot thickens

OC2.0.2.0 has a new error message on Add / Edit Product
add-error.jpg

add-error.jpg (28.73 KiB) Viewed 5571 times


New member

Posts

Joined
Sun Oct 10, 2010 12:31 am

Post by Webbo » Wed Apr 01, 2015 5:29 am

This fixed it for me

admin/config.php

define('HTTPS_SERVER', 'http://www.mysite.com/admin/');
define('HTTPS_CATALOG', 'http://www.mysite.com/');

Then changed the http to https as below:

define('HTTPS_SERVER', 'https://www.mysite.com/admin/');
define('HTTPS_CATALOG', 'https://www.mysite.com/');


its all about loopeback connections

Found the answer from > http://forum.opencart.com/viewtopic.php ... 8&start=20

New member

Posts

Joined
Sun Oct 10, 2010 12:31 am

Post by denny@dchost.co.za » Wed Apr 15, 2015 4:32 am

Guys I am using Version 2.0.2.0 and getting this error all of a sudden

on the last part of processing order when I confirm I get

SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
OK



My admin config looks like this, we are not running https at the moment this will be next phase of the project.

define('HTTP_SERVER', 'http://abacus-maths.co.za/orders/admin/');
define('HTTP_CATALOG', 'http://abacus-maths.co.za/orders/');

// HTTPS
define('HTTPS_SERVER', 'http://abacus-maths.co.za/orders/admin/');
define('HTTPS_CATALOG', 'http://abacus-maths.co.za/orders/')

I need to go live this week with the store any help please
Thanks


Posts

Joined
Wed Apr 15, 2015 4:23 am

Post by npn2531 » Sat May 23, 2015 6:53 am

None of the fixes posted in this thread or others are working for me, in my modified OC 2.0.2.0.
The only thing that 'fixes' it, is when that error occurs (3 times in two days), is to restore my site with the last backup I made.

Clearly since so many people are having the issue, and the 'fixes' folks are posting are all over the map, the issue must be with how 2.0.2.0 is written, i.e. it's a bug.

http://www.niora.com


New member

Posts

Joined
Tue May 19, 2009 11:56 am

Post by TheLizard » Sun May 24, 2015 8:44 pm

This is a bug.

I have tried :

-Maintaince mode on and off
-Created new APIs via the Admin and through phpMyAdmin
-Edited admin/controller/sale/order.php by adding after public function api() { $json = array();
-Fresh install
-PHP and cURL enabled on server
-SSL enabled on server

This is soo annoying that it is not address and not fixed. OpenCart is loosing my respect day and day and I am always actively promoting it. I might have to go the Magento bloated route..

Even the damn site documentation and downloading the latest release has a zip file that talks about upgrading 1.4 to 1.5 and nothing about 1.5 to 2.0 or anything about 2.0 upgrades - even on the website. It is so poor and embarassing.. To much brown sniffing and licking ass of the Leeds agency; welford media opencart

New member

Posts

Joined
Mon Feb 20, 2012 11:51 pm

Post by pta » Tue Jun 02, 2015 8:44 pm

hi,

I am posting this if i could have some solution.
I am using opencart 2.0.1.1 , lately i have some sales order which is successful, but by sales record are not found in admin part, i mean to say my order records are not stored or saved, but it has a record of customers login and information, but no sales record found even after sales.
hope to get some help.

Regards,
Pta

pta
New member

Posts

Joined
Sun Feb 08, 2015 11:54 am

Post by jan499 » Sat Jun 27, 2015 8:15 pm

The solution for me was to edit the etc/hosts file. Just add this:

wget www.yourdomain.com
curl www.yourdomain.com
telnet 0 80

Newbie

Posts

Joined
Sun Aug 18, 2013 4:53 am
Who is online

Users browsing this forum: No registered users and 98 guests