Page 3 of 5

Re: [SOLVED] Admin, Add or Edit Order - Unexpected end of in

Posted: Thu Feb 26, 2015 6:49 pm
by nhucbcb
Nesster wrote:SyntaxError: Unexpected end of input (Chrome)
SyntaxError: Syntax Error (IE)

Hi, I have searched high and low on this issue, as this error first appeared to be related with our site being password protected (apache .htaccess file). Now as I have verified and re-verified the virtual host where OpenCart is installed, I'm sure there is no password protection. There IS a virtual host that is protected in this way on our server, but it's not relevant to OC.

I made sure the API was set up correctly too. Even tried creating another API user to make sure.
The site is not in maintenance mode.

We are working on finding the source of this problem ourselves, but I'd like to know if others still have this issue (and without htpasswd protection).

GitHub version.

Frank
Hi,

Your problem is caused by:
1) Your site is Maintenance Mode. Please try disable it in In Opencart Admin, go to System >> Settings >> Edit >> Server tab >> Maintenance Mode: NO
2) Your language(new language) was error. Please try re-install the English language.
3) API user: In Opencart Admin, go to System >> Settings >> Users >> API and create a new user then go to System >> Settings >> Edit >> Option tab >> API User >> choose new API
4) Your hosting did disable the 443 port. Please try edit the file: admin/config.php
find the code:
define('HTTPS_CATALOG', 'https://yoursite.com/');
change to:
define('HTTPS_CATALOG', 'http://yoursite.com/');

change "https" to "http"

Re: [SOLVED] Admin, Add or Edit Order - Unexpected end of in

Posted: Tue Mar 31, 2015 1:18 pm
by rlasmar
I finally found my problem.

In my case was the language translation.

When in english everything worked, but when I changed to my language I can not edit orders.

So, I checked all files from my language translation and there's a few files in ANSI format, so I converted all to UTF-8 without BOM.

Now I can edit orders.

Re: [SOLVED] Admin, Add or Edit Order - Unexpected end of in

Posted: Sat Apr 04, 2015 9:43 am
by dancarp
Please try edit the file: admin/config.php
find the code:
define('HTTPS_CATALOG', 'https://yoursite.com/');
change to:
define('HTTPS_CATALOG', 'http://yoursite.com/');

change "https" to "http"

nhucbcb

Posts: 4
Joined: Thu Feb 26, 2015 6:22 am
Thank You, finally I have fixed my edit feature as well as digital downloads and who know what other possible problems there have been.
Make the changes in both config.php files "/config.php and admin/config.php"

Re: [SOLVED] Admin, Add or Edit Order - Unexpected end of in

Posted: Mon Apr 20, 2015 9:28 pm
by Ottiko
rachidgeldi wrote:
rangitotogirl wrote:Thanks for your help on this one, I managed to fix it. Just thought I'd rewrite it to make it a little clearer.

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 (it was set to 0 on my system).
5. Next go to table oc_api and check that api_id = 1
Thank you for summarizing. People for whom this doesn't work, might have forgotten to activate their newly made API user in the store settings.
Can't help...

Re: [SOLVED] Admin, Add or Edit Order - Unexpected end of in

Posted: Mon Apr 20, 2015 10:20 pm
by pm-netti
Ottiko wrote: Can't help...
You try SSL to Enabled and:

http://forum.opencart.com/viewtopic.php ... 40#p553299

Re: [SOLVED] Admin, Add or Edit Order - Unexpected end of in

Posted: Mon Apr 20, 2015 11:49 pm
by gilaraujo
Worth mentioning i had a similarish issue, all attempts were tried and i figured out in the end it was because my host decided to activate me the "free" Cloudflare thing. Thanks for that host! lol

Deactivated it, all working great now

Re: [SOLVED] Admin, Add or Edit Order - Unexpected end of in

Posted: Wed Apr 22, 2015 9:49 pm
by Ottiko
pm-netti wrote:
Ottiko wrote: Can't help...
You try SSL to Enabled and:

http://forum.opencart.com/viewtopic.php ... 40#p553299
I try, but didn't work...

Re: [SOLVED] Admin, Add or Edit Order - Unexpected end of in

Posted: Thu Apr 23, 2015 12:44 am
by pm-netti
Ottiko wrote:
pm-netti wrote:
Ottiko wrote: Can't help...
You try SSL to Enabled and:

http://forum.opencart.com/viewtopic.php ... 40#p553299
I try, but didn't work...
You check web hosting, is it php CURL in use.

Re: [SOLVED] Admin, Add or Edit Order - Unexpected end of in

Posted: Thu Apr 23, 2015 6:19 am
by Ottiko
cURL support: enabled :choke:

Re: [SOLVED] Admin, Add or Edit Order - Unexpected end of in

Posted: Thu Apr 23, 2015 3:48 pm
by pm-netti
Ottiko wrote:cURL support: enabled :choke:
How us HTTP Loopback connections?
http://forum.opencart.com/viewtopic.php ... rl#p552782
Others Curl settings?
http://curl.haxx.se/

Re: [SOLVED] Admin, Add or Edit Order - Unexpected end of in

Posted: Sat Apr 25, 2015 5:24 pm
by chilledworld
I have the same problem I cannot update the order status.
I get this error message SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data OK

I have tried changing the API without success.
Maintenance mode is off.

I changed the HTTPS to HTTP in admin/config.php and config.php
define('HTTPS_SERVER', 'http://www.mysite.com/admin/');
define('HTTPS_CATALOG', 'http://www.mysite.com/');
This worked. I changed the status on 7 orders but now it is not working again.

Any other ideas?
I have used OC since 1.4 and it has been amazing but this has got me stumped.

Re: [SOLVED] Admin, Add or Edit Order - Unexpected end of in

Posted: Sat Apr 25, 2015 6:49 pm
by pm-netti
chilledworld wrote:I have the same problem I cannot update the order status.
I get this error message SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data OK

I have tried changing the API without success.
Maintenance mode is off.

I changed the HTTPS to HTTP in admin/config.php and config.php
define('HTTPS_SERVER', 'http://www.mysite.com/admin/');
define('HTTPS_CATALOG', 'http://www.mysite.com/');
This worked. I changed the status on 7 orders but now it is not working again.

Any other ideas?
I have used OC since 1.4 and it has been amazing but this has got me stumped.
Is your SSL status enabled? If is, change this:

Code: Select all

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

Code: Select all

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

Re: [SOLVED] Admin, Add or Edit Order - Unexpected end of in

Posted: Sat May 16, 2015 2:24 pm
by imdevlper18
I had my store on maintenance mode. So order details were failing.
Removing from maintenance mode fixed the issue and i was able to edit the orders.

Re: [SOLVED] Admin, Add or Edit Order - Unexpected end of in

Posted: Sun May 24, 2015 8:18 pm
by Ottiko
I testing on localhost (Denwer).
I try to SSL, cURL is enable with this option http://i.imgur.com/x39sRmp.png
But bug is can't fixed... :-[

Re: [SOLVED] Admin, Add or Edit Order - Unexpected end of in

Posted: Fri Jul 03, 2015 4:44 pm
by nick5000
I can't get it to work.
Have tried the "official" fix to check api id, and have made sure I have API user selected.
tried disabling mod_security
tried curl domain in SSH, it works
tried changing from https to http in admin/config.php

Re: [SOLVED] Admin, Add or Edit Order - Unexpected end of in

Posted: Fri Jul 03, 2015 4:48 pm
by imdevlper18
Have you checked if store is not in maintenance mode ?

Re: [SOLVED] Admin, Add or Edit Order - Unexpected end of in

Posted: Fri Jul 03, 2015 6:11 pm
by nick5000
Yes, it's not in maintenance mode.

Php info says this, does this mean that the correct curl is enabled?

Configure Command
'./configure' '--disable-fileinfo' '--disable-pdo' '--disable-posix' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-mbstring' '--enable-sockets' '--enable-zip' '--prefix=/usr/local' '--with-apxs2=/usr/local/apache/bin/apxs' '--with-curl=/opt/curlssl/' '--with-freetype-dir=/usr' '--with-gd' '--with-imap=/opt/php_with_imap_client/' '--with-imap-ssl=/usr' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libxml-dir=/opt/xml2/' '--with-mcrypt=/opt/libmcrypt/' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-mysqli=/usr/bin/mysql_config' '--with-openssl=/usr' '--with-openssl-dir=/usr' '--with-pcre-regex=/opt/pcre' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--with-zlib' '--with-zlib-dir=/usr'


curl not mentioned anywhere else

Re: [SOLVED] Admin, Add or Edit Order - Unexpected end of in

Posted: Sat Jul 04, 2015 7:56 pm
by straightlight
After reading 3 pages on this topic, none could report if cURL support is enabled nor that could find a cURL version from phpinfo() nor stating the error logs on when and where exactly this error actually occurs when using the API under the admin orders page since it has never been asked to do so.

1 - Initiate phpinfo(), on a separate PHP file if you cannot either find it or run it under the admin section of OC. Then, execute it from browser. Do you see: cURL support set to enabled line under a table structure?

2 - Under the admin section of OC, click on the error log link below settings for v2.0x and under settings for v1.5x releases. What are the lines indicating regarding the reported issues particularly?

Re: [SOLVED] Admin, Add or Edit Order - Unexpected end of in

Posted: Sun Jul 05, 2015 12:42 am
by nick5000
straightlight wrote:After reading 3 pages on this topic, none could report if cURL support is enabled nor that could find a cURL version from phpinfo() nor stating the error logs on when and where exactly this error actually occurs when using the API under the admin orders page since it has never been asked to do so.

1 - Initiate phpinfo(), on a separate PHP file if you cannot either find it or run it under the admin section of OC. Then, execute it from browser. Do you see: cURL support set to enabled line under a table structure?

2 - Under the admin section of OC, click on the error log link below settings for v2.0x and under settings for v1.5x releases. What are the lines indicating regarding the reported issues particularly?
Mine is:

cURL support enabled
cURL Information 7.38.0

From the error log I find:

2015-07-04 16:36:48 - PHP Notice: Undefined variable: json in /home/XXX/public_html/admin/controller/sale/order.php on line 2222

Re: [SOLVED] Admin, Add or Edit Order - Unexpected end of in

Posted: Sun Jul 05, 2015 12:44 am
by straightlight
Great. Now, we have a bit more information regarding this problem. Which OC version are you using exactly?