Page 1 of 5

Undefined variable: json Error when Updating Order status

Posted: Sat Apr 04, 2015 8:24 pm
by dev9457
I am getting error when i am trying to edit order status / history --
PHP Notice: Undefined variable: json in /home/arrockr1/public_html/admin/controller/sale/order.php on line 2490
And also when i trying to edit order status in Total save button is not working.
Please give me a solution.

Re: Undefined variable: json Error when Updating Order statu

Posted: Sun Apr 05, 2015 10:22 pm
by aljawaid
I have the same problem on OC v2.2.0 :(

Re: Undefined variable: json Error when Updating Order statu

Posted: Mon Apr 06, 2015 12:26 am
by pm-netti
dev9457 wrote:I am getting error when i am trying to edit order status / history --
PHP Notice: Undefined variable: json in /home/arrockr1/public_html/admin/controller/sale/order.php on line 2490
And also when i trying to edit order status in Total save button is not working.
Please give me a solution.
You find this text admin/controller/sale/order.php on line 2423:

Code: Select all

        public function api() {
change to:

Code: Select all

	  public function api() {
		$json = array();

Re: Undefined variable: json Error when Updating Order statu

Posted: Sat Apr 18, 2015 6:48 pm
by psopa
Hi
i did this, and the error now changed to unexpected end of input...
any help please!
i'm not in maintenance mode, and it's a fresh install of 2.0.2.0

Re: Undefined variable: json Error when Updating Order statu

Posted: Mon Apr 20, 2015 5:12 am
by psopa
does anyone solved this? i tryed everything!...:(

Re: Undefined variable: json Error when Updating Order statu

Posted: Mon May 04, 2015 3:32 pm
by ashwani_multi
I got the same error and i fixed it

go to Admin->System->users->Api

Add a new api generate password, and enable it

Then go to Admin->system->settings->Edit->Option(tab)

Select api user under Checkout section as your api user

Then save the changes

Then go to Sales->orders->edit

It will work fine :-)

Re: Undefined variable: json Error when Updating Order statu

Posted: Sun May 10, 2015 7:07 am
by Vicx007
ashwani_multi wrote:I got the same error and i fixed it

go to Admin->System->users->Api

Add a new api generate password, and enable it

Then go to Admin->system->settings->Edit->Option(tab)

Select api user under Checkout section as your api user

Then save the changes

Then go to Sales->orders->edit

It will work fine :-)
I did this but still it didnt work can anyone help its annoying it has been two whole night i havent slept plssssssssssss :bash: :bash: :bash: :bash: :bash: :bash:

Re: Undefined variable: json Error when Updating Order statu

Posted: Wed May 13, 2015 9:34 am
by mcpop
I had the same problem as OP but none of the steps listed helped. I tried resetting the API password, reassigning the API user etc etc and didn't have any joy.

I also tried the code mods that were suggested in other threads ... no luck.

Then, when I thought things couldn't get any worse, I discovered I couldn't delete orders either. FFS!

Then I read somewhere that the OC admin module uses curl to send requests to the other parts of OC using http. Then I remembered that I had set a Basic AuthType in my .htaccess while I was still building the site (didn't want outsiders or bots indexing my junk data!)

I removed the Auth stuff from my .htaccess and now my order operations in admin all work properly.

So, if you also have these problems, check that your infrastructure allows your admin module to access your main OC site. In my case it was .htaccess but you may have some firewall restriction or a network restriction placed by your ISP or server provider.

Good luck.

McPop.

Re: Undefined variable: json Error when Updating Order statu

Posted: Wed May 13, 2015 10:41 pm
by cbutler7
Worked for me () :)

Re: Undefined variable: json Error when Updating Order statu

Posted: Fri May 22, 2015 12:21 am
by Ergotron_Mexico
mcpop wrote:I had the same problem as OP but none of the steps listed helped. I tried resetting the API password, reassigning the API user etc etc and didn't have any joy.

I also tried the code mods that were suggested in other threads ... no luck.

Then, when I thought things couldn't get any worse, I discovered I couldn't delete orders either. FFS!

Then I read somewhere that the OC admin module uses curl to send requests to the other parts of OC using http. Then I remembered that I had set a Basic AuthType in my .htaccess while I was still building the site (didn't want outsiders or bots indexing my junk data!)

I removed the Auth stuff from my .htaccess and now my order operations in admin all work properly.

So, if you also have these problems, check that your infrastructure allows your admin module to access your main OC site. In my case it was .htaccess but you may have some firewall restriction or a network restriction placed by your ISP or server provider.

Good luck.

McPop.

Mmm, i check this but i not have .htaccess file in admin folder how i can check this ?

Re: Undefined variable: json Error when Updating Order statu

Posted: Sat May 23, 2015 3:37 am
by npn2531
I removed the Auth stuff from my .htaccess and now my order operations in admin all work properly.
Can you be specific? What is 'Auth stuff'. I am getting the same error msg:

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

Re: Undefined variable: json Error when Updating Order statu

Posted: Sat May 23, 2015 5:52 am
by npn2531
Searching this forum I am coming with answers that are all over the map, from generating a new api

Code: Select all

http://stackoverflow.com/questions/27732677/opencart-2-0-0-syntaxerror-json-parse-unexpected-end-of-data-at-line-1-colu
to
removing 'auth stuff' from htaccess file (see above) to making sure mantenance mode is off, to changing HTTPS to HTTP in admin/config.php and config.php, etc.

Searching for 'opencart SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data OK' comes up with tons of people posting about having this problem, but very little in the way of an answer.

Is this an unresolved issue with Opencart? Or is there an official solution to this?

Re: Undefined variable: json Error when Updating Order statu

Posted: Sun May 24, 2015 8:47 pm
by TheLizard
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

Re: Undefined variable: json Error when Updating Order statu

Posted: Mon May 25, 2015 10:25 am
by casys123
Hellow everyone,

I got this error after installing a product configuration extension:

Fatal error: Cannot redeclare ModelCatalogProduct::editProductFee() in /home1/casys123/public_html/system/modification/admin/model/catalog/product.php on line 352


Please let me knwo how to fix it...Thanks

Re: Undefined variable: json Error when Updating Order statu

Posted: Mon May 25, 2015 5:53 pm
by vsjforall
Hi , BEEN Annoyed with the issue for a while. But solved it with the replies in this thread itself.

First You have to create the api user with the smae name and password as the original user you logged it. Can be done through

system-> settings ->edit -> options -> select user you created with same as the store owner

Then Edit the code in order.php with assignment as in above thread.

By doing both the above my problem is fixed and i can delete as well as edit the orders :)

Hope this piece of info helps you all

Re: Undefined variable: json Error when Updating Order statu

Posted: Wed May 27, 2015 8:03 am
by exit15
I tried all of the above, nothing helped. Cannot update order history. Is there another thread for this issue?
Version 2.0.2.0 fresh install.

Re: Undefined variable: json Error when Updating Order statu

Posted: Fri May 29, 2015 9:35 am
by exit15
Posted on another thread.. I found out that this was a CloudFlare related issue. As soon as I disabled CloudFlare DNS routing, the problem went away. This was also confirmed by other users, something in the way they resolve DNS does not sit well with cURL. I hope that this is reported as a bug (i'm not part of the github scene) and addressed. It's en easy test, enable DNS routing via ClouldFlare and the error pops, disable and its gone. Thanks.

Re: Undefined variable: json Error when Updating Order statu

Posted: Fri May 29, 2015 5:32 pm
by TheLizard
I don't use CloudFare and I am still getting this issue.

In fact, CloudFare is an embarrassment of a CDN. We have Rackspace Cloud and Akamai and S3 systems. This forum and site uses CloudFare and you get an annoying DDos que message; very amateur.

Re: Undefined variable: json Error when Updating Order statu

Posted: Mon Jun 01, 2015 5:01 am
by romeo2906
"Undefined variable: json in admin/controller/sale/order.php on line 2490"
The error occurs when you edit an order or when you want to change the status of an order.
I tried solving methods mentioned above but do not have a positive outcome.
Is it a bug in version 2.0.2.0?

Re: Undefined variable: json Error when Updating Order statu

Posted: Mon Jun 01, 2015 10:17 pm
by R1ant
Image


i got this error when i try to change order status any1 know how to solve it?