Post by jtsroberts » Wed Feb 19, 2014 10:20 am

I have an installation of OpenCart v 1.5.6. I'm getting the following error when attempting to login for checkout (see attachment for full details):

SyntaxError: JSON.parse: unexpected character

It's relating to catalog/controller/checkout/login.php on line 54 and 60 which as far as I can tell is kicking up a stink about the posted values for email and password.

I've never experienced this before in any installation so I'm not sure why it's happening. Any ideas?

Cheers

Attachments

oc.png

JSON.parse unexpected character - oc.png (10.08 KiB) Viewed 965 times


New member

Posts

Joined
Wed Nov 11, 2009 4:24 pm

Post by jtsroberts » Thu Feb 20, 2014 6:10 pm

I figured out the fix for this issue. To cut a long story short, the issue is that the checkout.tpl file in the default theme for opencart 1.5.6 has a bug in the login ajax function.

On line 137 in /catalog/view/theme/default/template/checkout/checkout.tpl I changed the code from this

Code: Select all

data: $('#checkout #login :input'),
to this

Code: Select all

data: $('#checkout #login input[type=\'text\'], #checkout #login input[type=\'password\']'),
This fixed the issue for me.

I sincerely hope this helps somebody else as this issue caused me a few hours of pulling my hair out, swearing, yada yada!

New member

Posts

Joined
Wed Nov 11, 2009 4:24 pm

Post by stokeyblokey » Thu Feb 20, 2014 10:19 pm

Hey well done! :)

I have never come across that bug but thanks to you we have a solution - you may wish to edit your opening title to include [SOLVED] to help others find it more easily, and I am linking to this thread from the old one you also posted in regarding the same issue.

Cheers,

Stokey

Stokey


User avatar
Active Member

Posts

Joined
Sat Aug 31, 2013 10:19 pm

Post by thepaladin » Mon Jul 07, 2014 10:39 pm

Schermata 2014-07-07 alle 16.38.13.png

Schermata 2014-07-07 alle 16.38.13.png (73.02 KiB) Viewed 848 times


Gracias ami me resolvio el problema !!!!

User avatar
Newbie

Posts

Joined
Thu Apr 19, 2012 11:44 pm
Location - Italy
Who is online

Users browsing this forum: No registered users and 50 guests