Unable to add items to cart

Hi guys



Every time I try to add an item in the store to the cart, I get this error at the top of the screen


[quote]ErrorOops, something went wrong (SyntaxError: Unexpected token <). Please try again.[/quote]



Got the same error when calculating shipping, but this was solved here:

V4 - JSON Error calculating shipping - Issues & Troubleshooting - CS-Cart Forums



Anybody else with this problem?

I just installed a trial of v4.2.4 and upon trying to add an item to the cart I get the error message as noted above:


[quote][color=#b22222]Oops, something went wrong (SyntaxError: Unexpected token <). Please try again.[/color][/quote]



This seems to be an almost 2 year old issue with no response.



Any help would be apreciated.

[quote name='AgentEccks' timestamp='1428977783' post='211344']

I just installed a trial of v4.2.4 and upon trying to add an item to the cart I get the error message as noted above:







This seems to be an almost 2 year old issue with no response.



Any help would be apreciated.

[/quote]



The issue can be caused by various number of reasons. Try to check server error logs

There is nothing to go on in the server logs.



I downloaded the raw Apache logs for the site in question, but when I click the Add To Cart button or Add to Wish List and get the error message, no error_log is generated in the account and the only thing that is listed in the logfile directly after that action is:


IP.Address - - [14/Apr/2015:13:08:08 -0700] "POST / HTTP/1.1" 200 16132 "http://domain.com/audio-downloads/URL/" "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36"



Any other suggestions?

In the config.local.php file there is the following tweak:



'disable_dhtml' => false, // Disable Ajax-based pagination and Ajax-based "Add to cart" button




Try to enable it and check if you still receive the error

Once disabled:


'disable_dhtml' => true



I no longer got the error message. When I click add to cart the whole page flashes, then pops up the modal window, rather than gracefully loading the modal window.



What would be the cause of this, and is it something I can fix or adjust?



Here's some additional information on php:



PHP Version 5.4.39
System Linux 2.6.18-371.4.1.el5 #1 SMP Thu Jan 30 06:08:24 EST 2014 x86_64
Build Date Mar 28 2015 04:33:59
Configure Command './configure' '--disable-fileinfo' '--enable-bcmath' '--enable-calendar' '--enable-exif' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-mbstring' '--enable-pdo=shared' '--enable-sockets' '--enable-zip' '--prefix=/usr/local' '--with-curl=/opt/curlssl/' '--with-freetype-dir=/usr' '--with-gd' '--with-gettext' '--with-imap=/opt/php_with_imap_client/' '--with-imap-ssl=/usr' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libdir=lib64' '--with-libxml-dir=/opt/xml2/' '--with-mcrypt=/opt/libmcrypt/' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-mysqli=/usr/bin/mysql_config' '--with-openssl=/usr' '--with-openssl-dir=/usr' '--with-pcre-regex=/opt/pcre' '--with-pdo-mysql=shared' '--with-pdo-sqlite=shared' '--with-pic' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--with-xsl=/opt/xslt/' '--with-zlib' '--with-zlib-dir=/usr'

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
with eAccelerator v0.9.6.1-ea, Copyright (c) 2004-2012 eAccelerator, by eAccelerator
with the ionCube PHP Loader v4.6.1, Copyright (c) 2002-2014, by ionCube Ltd., and
with Zend Guard Loader v3.3, Copyright (c) 1998-2013, by Zend Technologies




At least I can proceed to test now. Thanks for the advice!

Try to temporary disable eAccelerator. It can be the reason

I tried to disable [color=#282828][font=arial, verdana, tahoma, sans-serif]eAccelerator by adding:[/font][/color]



php_flag eaccelerator.enable 0
php_flag eaccelerator.optimizer 0






to my .htaccess file (per their instruction on Website), but I then get the following error:

Internal Server Error

[color=#000000]

The server encountered an internal error or misconfiguration and was unable to complete your request.[/color]

[color=#000000]

The error_log shows the following:[/color]

[color=#000000]

PHP Notice:  Undefined index: ekey in /home/username/public_html/app/controllers/frontend/orders.php on line 402

[quote name='AgentEccks' timestamp='1429238664' post='211788']

I tried to disable [color=#282828][font=arial, verdana, tahoma, sans-serif]eAccelerator by adding:[/font][/color]



php_flag eaccelerator.enable 0
php_flag eaccelerator.optimizer 0






to my .htaccess file (per their instruction on Website), but I then get the following error:

Internal Server Error



[color=#000000]The server encountered an internal error or misconfiguration and was unable to complete your request.[/color]



[color=#000000]The error_log shows the following:[/color]



[color=#000000]PHP Notice: Undefined index: ekey in /home/username/public_html/app/controllers/frontend/orders.php on line 402[/color]

[/quote]



Hello,



We can examin this issue and help you to solve it, just contact us.



Sincerely yours,

CS-Market.

[quote name='AgentEccks' timestamp='1429238664' post='211788']

I tried to disable [color=#282828][font=arial, verdana, tahoma, sans-serif]eAccelerator by adding:[/font][/color]



php_flag eaccelerator.enable 0
php_flag eaccelerator.optimizer 0






to my .htaccess file (per their instruction on Website), but I then get the following error:

Internal Server Error



[color=#000000]The server encountered an internal error or misconfiguration and was unable to complete your request.[/color]



[color=#000000]The error_log shows the following:[/color]



[color=#000000]PHP Notice: Undefined index: ekey in /home/username/public_html/app/controllers/frontend/orders.php on line 402[/color]

[/quote]



PHP Notice should not brake the store. It looks like the problem is in the .htaccess file. Some servers do not support such rules. Please ask server administrator to temporary disable eAccelerator