Jump to content

Can't add product to existing order


Tomas LT

Recommended Posts

Hello.

 

I can't add product to existing order in BO.

 

Test with prestashop online demo. Same issue, but error code in my store is different:

 

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:
Fatal error

 

How to fix this?

 

Thanks.

 

Link to comment
Share on other sites

Strange. The full message from live demo BO is:

Impossible to add the product to the cart.

textStatus: 'parsererror'
errorThrown: 'SyntaxError: JSON.parse: unexpected character at line 2 column 1 of the JSON data'
responseText:

Notice: Undefined variable: res in /space/apache/vhosts/demo-bo.prestashop.com/controllers/admin/AdminOrdersController.php on line 2182
{"result":true,"view":"\n\n\t\n\nNotice: Undefined index: customized_product_quantity in \/space\/apache\/vhosts\/demo-bo.prestashop.com\/tools\/smarty\/sysplugins\/smarty_internal_templatebase.php(157) : eval()'d code on line 49\n\n\t<\/td>\n\t\n\t\t\n\t\t\tBlouse - Size : S, Color : Black<\/span>
\n\t\t\tReference number demo_2
\t\t\t\t\t<\/a>\n\t<\/td>\n\t\n\t\t$27.00<\/span>\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t$ tax excl.<\/div>\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t$ tax incl.<\/div>\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t<\/td>\n\t\n\t\t\nNotice: Undefined index: customized_product_quantity in \/space\/apache\/vhosts\/demo-bo.prestashop.com\/tools\/smarty\/sysplugins\/smarty_internal_templatebase.php(157) : eval()'d code on line 106\n1<\/span>\n\t\t\t\t\n\t\t\t\n\t\t<\/span>\n\t\t\t<\/td>\n\t\t\t\t298<\/td>\t\n\t\t$27.00\n\t<\/td>\n\t <\/td>\n\t\n\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t<\/td>\n\t\n\t\t\t\n\t\n\t\t\t\t\n\t\t\t0\/1\n\t\t<\/td>\n\t\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tQuantity\n\t\t\t\t<\/label>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\/ 1<\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t\t\n\t\t\t\t\n\t\t\t\t\tAmount<\/span>\n\t\t\t\t\t(\nNotice: Undefined index: TaxMethod in \/space\/apache\/vhosts\/demo-bo.prestashop.com\/tools\/smarty\/sysplugins\/smarty_internal_templatebase.php(157) : eval()'d code on line 251\n)<\/small>\n\t\t\t\t<\/label>\n\t\t\t\t\n\t\t\t\t\t$<\/div>\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/i> \nNotice: Undefined index: TaxMethod in \/space\/apache\/vhosts\/demo-bo.prestashop.com\/tools\/smarty\/sysplugins\/smarty_internal_templatebase.php(157) : eval()'d code on line 262\n(Max $27.00 )<\/p>\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t<\/td>\n\t\t\n\t\t\t\t \n\t\t\t<\/td>\n\t\n\t\t\n\t\t\n\t\t\t
Link to comment
Share on other sites

Looks like you have development mode enabled, since you have a notice that is causing the AJAX to crash. You can either disable development mode or fix the notice by changing line 2153 of controllers/AdminOrdersController.php from:

        $refresh = false;

to:

        $refresh = false;
        $res = true;

This is a bug in PrestaShop that should be reported. Let me know if adding this line of code fixes your issue, then I'll submit a bug report.

 

A better solution may be to remove the $res variable altogether, since it doesn't appear to be used anywhere.

Link to comment
Share on other sites

  • 5 months later...

Looks like you have development mode enabled, since you have a notice that is causing the AJAX to crash. You can either disable development mode or fix the notice by changing line 2153 of controllers/AdminOrdersController.php from:

        $refresh = false;
to:

        $refresh = false;
        $res = true;
This is a bug in PrestaShop that should be reported. Let me know if adding this line of code fixes your issue, then I'll submit a bug report.

 

A better solution may be to remove the $res variable altogether, since it doesn't appear to be used anywhere.

 

I am using prestashop 1.6.0.6 and I am receiving same error when I click "add to cart button". I did look for the file and the variables but there were no such variables.

here is the error that I am receiving:

 

"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:

<html>

 

<head>

 

<title>PINKIERTHANBLUE.COM</title>

 

</head>

 

<body>

 

<p align="center">

 

<br>

 

<br>

 

<br>

 

<img border="0" src="http://i102.photobucket.com/albums/m115/pinkierthanblue/PTB%20uc-01_zpsfyfd0bnz.png"></p>

 

</body>

 

</html>

 

"

 

Any help will be appreciated!

Here is a link to my site: http://pinkierthanblue.com/index.php

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...