Page 1 of 2

SyntaxError: JSON.parse: unexpected character

Posted: Sat Jul 02, 2011 2:32 am
by stevedesign
Welcome i have error: SyntaxError: JSON.parse: unexpected character , I am from PoLAND and I use polish language which i translated from English. When I add polish language, I have error, choicing Flat Rate in Checkout >> Delivery ...I dont now why, because in English (language) when i choice in shop everything is ok in Polish not ;/ sory my English ist not good < Can someone help me ?

Re: SyntaxError: JSON.parse: unexpected character

Posted: Fri Jul 22, 2011 10:22 pm
by minijus
Hello,
I have website in 6 languages and I experience the same error in 4 langauges (Duetsch, French, Russian and Spanish) while English and Lithuanian works perfect.
Currently I am working on this issue but nothing comes to my mind. Does anybody else experienced the same issue ? Is there a solution for this error ?

Re: SyntaxError: JSON.parse: unexpected character

Posted: Fri Jul 22, 2011 10:47 pm
by Daniel
does your servers have the php json extension installed? if not it will be using the json functions i created.

Re: SyntaxError: JSON.parse: unexpected character

Posted: Sat Jul 23, 2011 4:50 pm
by minijus
Daniel wrote:does your servers have the php json extension installed? if not it will be using the json functions i created.
Yes,
my server support json:
json support enabled
json version 1.2.1

Re: SyntaxError: JSON.parse: unexpected character

Posted: Tue Jul 26, 2011 7:33 pm
by minijus
any ideas where I could start looking for problem?

Re: SyntaxError: JSON.parse: unexpected character

Posted: Tue Jul 26, 2011 9:59 pm
by Daniel
which language pack did you use?

also if you did the translation your self which php editor did you use?

if its a .net editor sometimes Microsoft adds stuff to the header of files.

Re: SyntaxError: JSON.parse: unexpected character

Posted: Tue Jul 26, 2011 11:12 pm
by ripper
I have the same problem. Even when I chose English it's still the same error. How can I find if I have json installed? I read that from PHP 5.2 it's automatically in the package. I have it on local.

Thx

Re: SyntaxError: JSON.parse: unexpected character

Posted: Wed Jul 27, 2011 12:08 am
by minijus
Daniel wrote:which language pack did you use?

also if you did the translation your self which php editor did you use?

if its a .net editor sometimes Microsoft adds stuff to the header of files.
I use 5 additional lang packs and all of them are downloaded from opencart.com website. Is there any way I could check them?

Re: SyntaxError: JSON.parse: unexpected character

Posted: Wed Jul 27, 2011 7:59 pm
by Daniel
but which ones? which ones is this happening with.

any idea which characters are causing the problem?

try typing in your alaphabet and when you come to the one that stops working let me know.

Re: SyntaxError: JSON.parse: unexpected character

Posted: Wed Jul 27, 2011 8:05 pm
by ripper
Daniel wrote:but which ones? which ones is this happening with.

any idea which characters are causing the problem?

try typing in your alaphabet and when you come to the one that stops working let me know.
Hi,
I have the same problem with English too. Do you have any idea?

Re: SyntaxError: JSON.parse: unexpected character

Posted: Wed Jul 27, 2011 8:55 pm
by Daniel
ripper wrote:
Daniel wrote:but which ones? which ones is this happening with.

any idea which characters are causing the problem?

try typing in your alaphabet and when you come to the one that stops working let me know.
Hi,
I have the same problem with English too. Do you have any idea?

which character?

is it when you use " or ' or something?

Re: SyntaxError: JSON.parse: unexpected character

Posted: Wed Jul 27, 2011 9:02 pm
by Daniel
ripper wrote:
Daniel wrote:but which ones? which ones is this happening with.

any idea which characters are causing the problem?

try typing in your alaphabet and when you come to the one that stops working let me know.
Hi,
I have the same problem with English too. Do you have any idea?

ok pm me access to your4 site and tell me how to produce the problem.

Re: SyntaxError: JSON.parse: unexpected character

Posted: Wed Jul 27, 2011 11:18 pm
by ripper
Daniel wrote:
ripper wrote:
Daniel wrote:but which ones? which ones is this happening with.

any idea which characters are causing the problem?

try typing in your alaphabet and when you come to the one that stops working let me know.
Hi,
I have the same problem with English too. Do you have any idea?

ok pm me access to your4 site and tell me how to produce the problem.
I have it in VmWare for testing. It doesn't write any character. :(

Re: SyntaxError: JSON.parse: unexpected character

Posted: Tue Aug 02, 2011 9:44 pm
by pminne
Having this problem as well, and looking for a way to solve it, I noticed this "$json = array();" in /catalog/controller/checkout/confirm.php (around line 50).
This seems a bit strange since there may be values assigned already to $json. Moving this declaration to the top doesn't solve the issue of the JSON error, but I thought it's worth mentioning it whatsoever.

Re: SyntaxError: JSON.parse: unexpected character

Posted: Wed Aug 03, 2011 3:51 am
by Daniel
could it be a missing file?

ok some one who is having this problem please pm me their login ftp details.

Re: SyntaxError: JSON.parse: unexpected character

Posted: Sat Aug 13, 2011 2:29 pm
by jisuanji8509
i have the same issue. i test one of my module is normal when i upload to server,it tips "SyntaxError: JSON.parse: unexpected character". i don't know why?

Re: SyntaxError: JSON.parse: unexpected character

Posted: Mon Aug 15, 2011 2:05 am
by Daniel
just tested this on someone's site and it looks like the problem happens when no shipping options are available.

Re: SyntaxError: JSON.parse: unexpected character

Posted: Mon Aug 15, 2011 2:12 am
by Daniel
ok found out this person could not load a require model on a custom payment method.

Re: SyntaxError: JSON.parse: unexpected character

Posted: Mon Aug 15, 2011 11:27 pm
by eddshouse
hi, im having the same error, tryng to checkout out using paypal standard and weight based shipping and it comes up. im using th latest build of opencart
thanks

Re: SyntaxError: JSON.parse: unexpected character

Posted: Mon Aug 15, 2011 11:30 pm
by Qphoria
Yea this error is non-specific and can happen at any step in the checkout, most notably the shipping and payment selection steps.
It can happen for a number of reasons
- Bug in the code, making it very difficult to debug
- Missing a file
- Unexpected data

I hope we can find a better way to report the actual php error back to ajax.