Jump to content

Impossible to add the product to the cart


kristoz

Recommended Posts

I have weird problem , when I log in with customer account and try to add product to cart I am getting this error

If I am using Firefox browser:

Impossible to add the product to the cart.
textStatus: 'parsererror'
errorThrown: 'SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data'
responseText:

If I am using Microsoft Edge

Impossible to add the product to the cart.
textStatus: 'parsererror'
errorThrown: 'SyntaxError: Invalid character'
responseText:

I am getting this error only 1 time if I want to try to add it again everything is working.. could someone tell me how can I fix this problem?

Link to comment
Share on other sites

Firebug is showing this

<p class="fancybox-error">Impossible to add the product to the cart.<br>textStatus: 'parsererror'<br>errorThrown: 'SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data'<br>responseText:<br>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="et-ee"><![endif]-->
<!--[if IE 7]><html class="no-js lt-ie9 lt-ie8 ie7" lang="et-ee"><![endif]-->
<!--[if IE 8]><html class="no-js lt-ie9 ie8" lang="et-ee"><![endif]-->
<!--[if gt IE 8]> <html class="no-js ie9" lang="et-ee"><![endif]-->

Link to comment
Share on other sites

It seems it's loading the full website instead of a JSON response. I have no idea why. Perhaps a parameter is wrong? Is there any error message being displayed further down in the response?

 

It may be easier if you can provide a link to your website.

Link to comment
Share on other sites

I was only able to reproduce the issue once. Now, adding the product to the cart works every time even after clearing my cookies. The one time I was able to reproduce the problem, the AJAX request had a "302 Moved Temporarily" error message, so it seems the URL is incorrect. That's a different error than you are getting though.

 

You can try editing config/defines.inc.php and changing the value of _PS_MODE_DEV_ from false to true and then see if you can reproduce the problem. Maybe that will provide more information. But the rarity of the issue makes me think it's not something to be greatly concerned about.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...