Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't edit an order, getting syntax error #2587

Closed
dazzyweb opened this issue Jan 21, 2015 · 12 comments
Closed

Can't edit an order, getting syntax error #2587

dazzyweb opened this issue Jan 21, 2015 · 12 comments

Comments

@dazzyweb
Copy link

When i go to edit an order and press continue I get the following pop up message:

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

orders

The site is not password protected or in maintenance mode.It is a totally clean install. I also tried switching mod_security off

I noticed the same issue as well on Opencarts admin demo if that means anything.

For what it's worth my web hosting provider (one of biggest in UK) told me that the following:

'Opencart 2 will not work on our systems due to loopback connections being blocked'

@Tangol
Copy link

Tangol commented Jan 22, 2015

Duplicate #2567

@dazzyweb
Copy link
Author

For anyone else reading this it appears that if your hosting provider does not support CURL connections then they will not be able to support opencart and you will have the same issue.

@CoverUp
Copy link
Contributor

CoverUp commented Jan 22, 2015

most payments and shipping modules relay in curl, so it will not be functional at all. but the ajax stuff i a different thing

@dazzyweb
Copy link
Author

I did manage to fix the issue in the end though I don't fully understand how this sorted it out.

I Opened config.php in the admin folder and found the following lines

define('HTTPS_SERVER', 'http://www.mywebsite.uk/admin/');
define('HTTPS_CATALOG', 'http://www.mywebsite.uk/');

Then changed the http to https as below:

define('HTTPS_SERVER', 'https://www.mywebsite.uk/admin/');
define('HTTPS_CATALOG', 'https://www.mywebsite.uk/');

This sorted it out for me.

@psitsolution
Copy link

official demo site of opencart 2.0.1.1 have the same problem "sintax error"!!!! it's a bug???
captura de pantalla 2015-03-21 a la s 13 05 09

@gilsamuelaraujo
Copy link
Contributor

I had the same issue and tried all workarround possible and imaginary.

In the end gave up and called my Hosting - SiteGround - They found that OpenCart wont run propperlly on any php version above 5.4.33. USE 5.4.33

This might not solve all issue, or might work only in conjunction with other fixes ABOVE but worth a try to check which php version your Hosting is running by default.

Regards
Stock

@muhammadkholidb
Copy link

I think I found the solution for this issue, since in OpenCart 2 it uses API so you need to do these steps:

  1. Make sure you have created user API in menu System / Users / API
  2. Then in System / Settings, choose your store, select Options tab
  3. In Checkout section, choose API User you just created
  4. Save your settings
  5. Try to add or edit an order again, it should be working.

@gilsamuelaraujo
Copy link
Contributor

Didnt work for me. Only being sure my host was on Php 5.4.33 fixed it. And yes i tried ALL them sugestions. Even editing the SQL itself. None worked

@muhammadkholidb
Copy link

I am using PHP 5.5.21 and it is working well. Try to double check the steps I mentioned above.

@gilsamuelaraujo
Copy link
Contributor

For me all was working well, and IS, on a sandobox i am using.
The moment you start adding themes, and extensions.. breaks!
Untill you downgrade the Php to 5.4.33
(again i am basing myself on the findings of siteground tech suport)

@patricmutwiri
Copy link

THis worked like charm for me.
I had this particular issue. Once an order is created, I, the Admin, couldn't edit the order. It's not a bug or anything. It's a security update which opencart implemented via user/api, and is called during several operations on site, ie Order Additions, Deletions or Modifications.

For it to work for you, ask your host to disable mod_security for urls with "admin", or urls containing your IP Address, or check if your htaccess can overide and disable it from there.

You can also exclude per request/method type 'POST' or 'GET'.

Please note, Latest mod_sec is mod_security2

Guess am happy after I found out the real issue.
opencart_order_edit

@pwiking
Copy link

pwiking commented Jan 10, 2018

I have created a fix for this order update page JSON error.
If you have JSON error you can replace it with my module. Read the readme file to set up.
Download at: www.advertigo.net/orderstatus.zip

Sincerely, Mike
Advertigo.net team

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants