error message - Impossible to add products to cart - Ecommerce x PrestaShop [ARCHIVE BOARD] - PrestaShop

Jump to content


error message - Impossible to add products to cart


Posted 28 September 2009 - 05:44 PM


    PrestaShop Newbie

  • Members
  • Pip
  • 17 Active Posts
My online store had been working fine until 2 weeks ago.
I have install
and impossible to add products to cart
TECHNICAL ERROR: unable to add the product.

Error thrown: [object XMLHttpRequest]
Text status: error

What can be done?



Posted 29 September 2009 - 07:53 PM


    PrestaShop Enthusiast

  • Members
  • PipPip
  • 158 Active Posts
The error means that the Javascript retrieving cart information from Prestashop ran into issues parsing the response that came back from the server. This could be for any number of reasons - your browser is doing something funny, there is product data with unescaped characters causing problems, something messed up with the JSON generation code on the server, extra text getting prepended or appended to the output, etc.

The first thing I would suggest is that you disable Javascript in your browser temporarily and see if you can add products normally. If that works fine, then the issue has got to be related to Javascript either on your machine or in the output coming back from the server.

You can manually inspect what is being sent by calling the cart directly by calling the cart directly. If you view the source to your product page you will find a section like this:

<input type="hidden" name="token" value="00757d49336c884062383c23" /><input type="hidden" name="id_product" value="1" id="product_page_product_id" /><input type="hidden" name="add" value="1" /><input type="hidden" name="id_product_attribute" id="idCombination" value="" />

Plug your token and id_product values in to the following URL:


You would replace everything up to "cart.php" with the URL to your shop, your product id instead of "1" and your token value instead of "00757d49336c884062383c23". If you access this URL in your browser, you should be given some text representing a JSON object (Javascript representing your cart contents) which should look something like this:

{'products': [    {        'id':            2,        'link':          '',        'quantity':      2,        'priceByLine':   '158,00 €',        'name':          'iPod shuffle',        'price':         '158,00 €',        'idCombination': 8,        'hasAttributes': true,        'attributes':    'Green',        'hasCustomizedDatas': false,        'customizedDatas':[                ]    },    {        'id':            1,        'link':          '',        'quantity':      4,        'priceByLine':   '756,20 €',        'name':          'iPod Nano',        'price':         '756,20 €',        'idCombination': 31,        'hasAttributes': true,        'attributes':    'Black, 16Go',        'hasCustomizedDatas': false,        'customizedDatas':[                ]    },],'discounts': [],'shippingCost': '0,00 €','wrappingCost': '0,00 €','nbTotalProducts': '6','total': '914,20 €','productTotal': '914,20 €','hasError' : false}

My guesses here are:

1. there will be an error message or extraneous HTML embedded in the array returned making it unparseable (track down the source of the error)

2. a product has text in it that is breaking the array due to lack of proper escaping (change the product details)

3. your browser has a taskbar or something similar installed that is messing with its Javascript behaviour

CODEgrunt Consulting - total geek trash, coder / troubleshooter for hire


Posted 04 October 2009 - 04:37 PM


    PrestaShop Newbie

  • Members
  • Pip
  • 16 Active Posts
There is also a problem in which i found that if you don't have a default carrier setup in presta back end you will also get that problem with parse error and when you click view cart you get a hack attempt error. maybe this will help?


Posted 01 December 2009 - 10:25 PM


    PrestaShop Newbie

  • Members
  • Pip
  • 18 Active Posts
I've found the solution!)) Thanks you very much, codegrunt!
I've tried to enter url in browser as you told: "cart.php?add&ajax=true&qty=1&id_product=1&token=c111e173641a40c51b739ca280ac2fe7". And I've found the reason: there was a mysql warning (my "display_errors" in had been turned to "on") like
Warning: Unknown: 1 result set(s) not freed. Use mysql_free_result to free result sets which were requested using mysql_query() in Unknown on line 0

in the end of json response cart.php returned.
I've just turned display_errors to "off" and everything works fine!

Does anybody know how to remove this warning at all, even if display_errors turned on?


Posted 08 February 2014 - 08:43 PM


    PrestaShop Newbie

  • Members
  • Pip
  • 1 Active Posts
the very first idea is actually a plastic animal mug that will come in a variety of themes elephant

Halloween fun over time could involve pranks such as strewing toilet paper around tree divisions, painting graffiti in items together with aerosol shaving cream, doll tricks that pop up once the tricker shakes fingers with the treater, for example buzzers or coils. The pranks or techniques were relatively harmless, however in many places abroad, many Halloween things to do are totally banned. Enjoyable for Hallow's eve also includes haunted houses, parties having games and also refreshments which sport trick or treat costumes and either an autumn or haunted theme..

You can find plus-sized dresses for female in a wide variety online unlike the past in which the clothes began in limited quantity not to mention that these people were very costly without necessarily trendy. Therefore, i thought this was a major problem in which plus sized females who were in a position to become modern experienced. Now, all these issues have been fixed and plus sized women can certainly dress fashionably like any body else.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cookies help us deliver our services. By using our services, you agree to use our cookies.     Learn more