Koselya Posted October 16, 2016 Share Posted October 16, 2016 Hello, After activating the friendly url, ajax cart started not to work anymore given this message hereunder when adding an article to the cart. And in fact there is no error as the product is well added to the cart despite the message Impossible to add the product to the cart.textStatus: 'parsererror'errorThrown: 'SyntaxError: Unexpected token in JSON at position 0'responseText:{"products":[{"id":8,"link":"http:\/\/koselya.com\/fr\/chemises-hommes\/8-absolue-homme.html#\/taille-40","quantity":4,"image":"http:\/\/koselya.com\/137-home_default\/absolue-homme.jpg","image_cart":"http:\/\/koselya.com\/137-cart_default\/absolue-homme.jpg","priceByLine":"600,00 \u20ac","name":"Absolue","price":"600,00 \u20ac","price_float":500,"idCombination":10,"idAddressDelivery":5,"is_gift":false,"hasAttributes":true,"attributes":"40","hasCustomizedDatas":false,"customizedDatas":[]}],"discounts":[],"shippingCost":"0,00 \u20ac","shippingCostFloat":0,"wrappingCost":"0,00 \u20ac","nbTotalProducts":4,"total":"600,00 \u20ac","productTotal":"600,00 \u20ac","freeShipping":"0,00 \u20ac","freeShippingFloat":0,"free_ship":true,"isVirtualCart":false,"hasError":false} So I removed friendly url but the issue stays. So I desactivated Ajax cart and it worked (it seems this is the sad end for most of the people having the issue). Now I put back the friendly URL as it doesn't change anything anymore. But I want the ajax cart to be back. The strangest thing with this issue is that I am connected with English language (id=2) I don't have the issue, and while connected in French (id=1) I get the issue... My website : http://koselya.com (ajax is deactivated as I have customer wishing to use a working website...) If anyone has a robust proposal? PS : I have no google analytic activated, nor paypal and I tried everything on the forums without any working solution Link to comment Share on other sites More sharing options...
Knowband Plugins Posted October 17, 2016 Share Posted October 17, 2016 The problem that you are facing might be occurring because of some recent changes that you have done on your store. You can try reverting the recent changes and see if this fixes your issue or not. You can also try the following module. http://addons.prestashop.com/en/17893-knowband-add-to-cart-popup-ajax-cart.html It offers a better design and doesn't have any issue while adding products to cart. It is a standalone module and doesn't have any dependency on any other module. Link to comment Share on other sites More sharing options...
Koselya Posted October 17, 2016 Author Share Posted October 17, 2016 Thank you for the proposal. Yes the issue immediately appeared after activating the friendly urls (and nothing else) but when reverting the issue stays... Link to comment Share on other sites More sharing options...
El Patron Posted October 18, 2016 Share Posted October 18, 2016 please check that you do not have PrestaShop debug mode enabled, this can cause cart to fail and maybe when you enable frienendly there is some code that is getting a warning.. if not enabled, then enable it to see if there is php error displayed.... without looking for error as underlying reason...then all hope is lost. Link to comment Share on other sites More sharing options...
Koselya Posted October 18, 2016 Author Share Posted October 18, 2016 Thanks a lot for your answer, debug mode is not activated. While activated I can't even access to the product page to test the "add to cart" button (see hereunder message). But nevermind, I commented lines 791 and 794 of the Db.php file and was able to access to the product and to test the "add button", result is exactly the same and no PHP error displayed... Again the strangest point with my issue is that it works with one of the language and not with the other. By reading the number of pages on blogs on this issue I know I am not the only one in my situation and that the sad result is that most of the people deactivate the ajax cart (or goes to another solution, which will be maybe my choice at the end...) _______________ [PrestaShopDatabaseException]Table 'ovh_prestashop.iwl775favorite_product' doesn't exist SELECT COUNT(*) FROM `iwl775favorite_product` WHERE `id_customer` = 1 AND `id_product` = 11 AND `id_shop` = 1 LIMIT 1at line 791 in file classes/db/Db.php 786. if ($webservice_call && $errno) {787. $dbg = debug_backtrace();788. WebserviceRequest::getInstance()->setError(500, ' '.$this->getMsgError().'. From '.(isset($dbg[3]['class']) ? $dbg[3]['class'] : '').'->'.$dbg[3]['function'].'() Query was : '.$sql, 97);789. } elseif (_PS_DEBUG_SQL_ && $errno && !defined('PS_INSTALLATION_IN_PROGRESS')) {790. if ($sql) {791. throw new PrestaShopDatabaseException($this->getMsgError().'<br /><br /><pre>'.$sql.'</pre>');792. }793.794. throw new PrestaShopDatabaseException($this->getMsgError());795. }796. } DbCore->displayError - [line 425 - classes/db/Db.php] - [1 Arguments] DbCore->query - [line 690 - classes/db/Db.php] - [1 Arguments] DbCore->getRow - [line 723 - classes/db/Db.php] - [2 Arguments] DbCore->getValue - [line 109 - modules/favoriteproducts/FavoriteProduct.php] - [1 Arguments] FavoriteProduct::isCustomerFavoriteProduct - [line 98 - modules/favoriteproducts/favoriteproducts.php] - [2 Arguments] FavoriteProducts->hookDisplayLeftColumnProduct - [line 587 - classes/Hook.php] - [1 Arguments] HookCore::coreCallHook - [line 542 - classes/Hook.php] - [3 Arguments] HookCore::exec - [line 274 - controllers/front/ProductController.php] - [1 Arguments] ProductControllerCore->initContent - [line 189 - classes/controller/Controller.php] ControllerCore->run - [line 367 - classes/Dispatcher.php] DispatcherCore->dispatch - [line 28 - index.php] Link to comment Share on other sites More sharing options...
Koselya Posted November 1, 2016 Author Share Posted November 1, 2016 (edited) In http://koselya.com : - appearance (CSS formating) is different in english and in french) - the web brower icon appears only on english pages (and admin) but not on french table - In French language, fancybox does not popup for sizetranslation module (on product #display size chart, please refer to printscreen). It is also blocking "add to cart" fancybox popup when AJAX cart is activated. Issue was traced by Prestashop support to classes/Language.phpfunction getIsoById() the issue was post on forge but no answer so far any idea someone ? UTF formating didn't solve the problem Edited November 1, 2016 by Koselya (see edit history) Link to comment Share on other sites More sharing options...
Scartman Posted July 12, 2017 Share Posted July 12, 2017 I have been banging my head for quite a while, trying to figure this one out... In my research of this issue, someone mentioned that their database had an invalid field? The only application I have used that utilises the database in such a way was RockPOS. So, I un-installed it and - bingo! Website back to working again. Obviously the RockPOS module is the issue, so I will be contacting the developer and asking for my money back. Link to comment Share on other sites More sharing options...
joaocarloszen Posted September 13, 2019 Share Posted September 13, 2019 Sorry my poor English, I was having the same problem and I hit my head a long time until I could solve it, at least mine went back to work, I enabled output_buffering = On in hp.ini on the server and the ajax part of the add button again worked to cart. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now