asosservis Posted February 7, 2017 Share Posted February 7, 2017 Hello. I have very unusual problem only with some items but i dont know how much of them have the same problem because i have over 19000 items and can not test each one. The server throws error when trying to add the item to the cart. I am attaching a screenshot of the error. This is only on some items. I hope that somebody could help me to solve this problem. Link to comment Share on other sites More sharing options...
NemoPS Posted February 8, 2017 Share Posted February 8, 2017 Can you share the site's url? It's pretty common actually Link to comment Share on other sites More sharing options...
asosservis Posted February 8, 2017 Author Share Posted February 8, 2017 Can you share the site's url? It's pretty common actually Hello here is a direct link to the items where i am getting error https://topprodaja.eu/videno-na-tv-u-pocetna-idejal/731-prijenosna-elektricna-susilica-za-odjecu-balon-vjesalica-4899888100591.html Link to comment Share on other sites More sharing options...
NemoPS Posted February 10, 2017 Share Posted February 10, 2017 Turn on dev mode in defines.inc.php, it's a 500 page Link to comment Share on other sites More sharing options...
asosservis Posted February 10, 2017 Author Share Posted February 10, 2017 I dont really know how to turn on dev mode. Can You explain it step by step. Thanks Link to comment Share on other sites More sharing options...
rocky Posted February 11, 2017 Share Posted February 11, 2017 Edit config/defines.inc.php and change line 29 from: define('_PS_MODE_DEV_', false); to: define('_PS_MODE_DEV_', true); Link to comment Share on other sites More sharing options...
NemoPS Posted February 11, 2017 Share Posted February 11, 2017 After doing what rocky suggested, try adding to the cart again, inspect the network tab in chrome's debug console and see what the response for the add to cart is Link to comment Share on other sites More sharing options...
asosservis Posted February 12, 2017 Author Share Posted February 12, 2017 After doing what rocky suggested, try adding to the cart again, inspect the network tab in chrome's debug console and see what the response for the add to cart is Ok i made this and now when try adding to a cart i am getting a very long error message so i hope somebody from You will help me. Here is a copy paste of a complete error. You can try yourself to add this to cart and You will see it. Impossible to add the product to the cart. textStatus: 'parsererror' errorThrown: 'SyntaxError: Unexpected token < in JSON at position 0' responseText: Fatal error: Uncaught exception 'Exception' with message 'Forbidden chars in cookie' in /home/topproda/public_html/classes/Cookie.php:176 Stack trace: #0 /home/topproda/public_html/modules/ganalytics/ganalytics.php(841): CookieCore->__set('ga_cart', 'a:1:{i:731;a:11...') #1 /home/topproda/public_html/classes/Hook.php(587): Ganalytics->hookActionCartSave(Array) #2 /home/topproda/public_html/classes/Hook.php(542): HookCore::coreCallHook(Object(Ganalytics), 'hookactionCartS...', Array) #3 /home/topproda/public_html/classes/Cart.php(214): HookCore::exec('actionCartSave') #4 /home/topproda/public_html/classes/Cart.php(1071): CartCore->update() #5 /home/topproda/public_html/controllers/front/CartController.php(300): CartCore->updateQty(1, 731, 0, 0, 'up', 0) #6 /home/topproda/public_html/controllers/front/CartController.php(73): CartControllerCore->processChangeProductInCart() #7 /home/topproda/public_html/classes/controller/Controller.php(178): CartControllerCore->postProcess() #8 /home/topproda/public_html/classes/Dispatcher. in /home/topproda/public_html/classes/Cookie.php on line 176 Link to comment Share on other sites More sharing options...
rocky Posted February 13, 2017 Share Posted February 13, 2017 Looks like a bug in the Google Analytics module. It's writing illegal characters to the cookie. You can disable that module until you're able to find a solution. Link to comment Share on other sites More sharing options...
NemoPS Posted February 13, 2017 Share Posted February 13, 2017 I bet it's because your site is using a language with non unicode chars, they probably need to be encoded by the module...but they are not, doesn't look easy as it's the module's fault, as rocky pointed out Link to comment Share on other sites More sharing options...
asosservis Posted February 19, 2017 Author Share Posted February 19, 2017 I bet it's because your site is using a language with non unicode chars, they probably need to be encoded by the module...but they are not, doesn't look easy as it's the module's fault, as rocky pointed out Do You maybe know how it would be possible to solve this problem because i really need to use a google analytics module. Now i have turned it off but i would need to use this. Thanks Link to comment Share on other sites More sharing options...
NemoPS Posted February 23, 2017 Share Posted February 23, 2017 You can try with htmlspecialchars but i don't know if it will do the trick Link to comment Share on other sites More sharing options...
asosservis Posted February 23, 2017 Author Share Posted February 23, 2017 You can try with htmlspecialchars but i don't know if it will do the trick Tell me please how can i install htmlspecialchars Link to comment Share on other sites More sharing options...
NemoPS Posted February 24, 2017 Share Posted February 24, 2017 It's not a module, you need to modify the js and see if you can use htmlspecialchars(string) on the string it sends over 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