Oris Sin
Oris Sin

Reputation: 1234

Can't add or subtract products with 1 item in stock - gettin a textStatus:'error' - Prestashop

I have been having this problem for a week almost in my Prestashop 1.6.0.13.
My question is that when I go to Prestashop Men's section and try to add products to cart (with 1 item in stock).
I have enabled the option for advanced stock management but it didn't seem to help me out on my problem. I get the next following message:

"Impossible to add the product to the cart
textStatus:error
errorThrown
responseText;"


The weird thing is that when I try to refresh the product item, it appears on my cart. The same happens when I subtract the product from my cart.
From the other side, it doesn't seem to be a problem for the rest of categories. I double checked the URLs also to see if there was a conflict between friendly URL's and cart but I deem that the problem doesn't lie there. I disabled the Ajax cart also to see if the problem lied there but no solution either. Currently, I am using the default Prestashop cart block.
I found a way solving the problem by uninstalling Google Analytics module but it isn't what I really want for solution because I need it in order to make reports on statistics.
Has anybody encountered any similar problem and found a solution ?
Please, if you have any suggestions on solving this matter, I would be really glad.

Thanks,
Orestis

Upvotes: 1

Views: 1045

Answers (2)

Oris Sin
Oris Sin

Reputation: 1234

Ok the solution was to remove "|" from every product description in Back-Office, which was the source of the problem. The products that had it, was creating a PHP Fatal error: Uncaught exception 'Exception' with message 'Forbidden chars in cookie' in /var/sites/c/caneihavethis.com/public_html/classes/Cookie.php:169. I wouldn't recommend though to edit the Cookie.php line. Just by removing this char, Google Analytics won't give problems in adding or subtracting a product.

Upvotes: 2

Indrė
Indrė

Reputation: 1136

On pressing Add to cart button it sends data and gets a response in JSON format. In your site there is a syntax error in that response.

It is not easy to find the reason and fix it. But you can:

  • If you have experienced that uninstalling Google Analytics module is fixing it - you must be sure you have configured it properly or you should try to use another module. Though the problem can not necessary be related directly...
  • Advanced. Use Firefox Firebug addon and check in its Console what is the full response on pressing Add to cart. It shows more information about what is causing this error.

    You can find many tutorials how to use Firefox Firebug, it is quite simple. You can find the reason, uninstall buggy modules or themes, but it is possible you need to get a help from a coder to fix it finally.

    Where to check in Firefox Firebug

  • Get a help from a coder.

Upvotes: 1

Related Questions