Jump to content

Impossible To Add Product To The Cart


hobbychan

Recommended Posts

Dears, 

 

My shop was working fine, until I recently purchased an addon from Prestashop for pre-orders. 

Once addon was installed, the issue came up, I can't add products to cart and I get this error message:

 

Impossible to add the product to the cart.
textStatus: 'parsererror'
errorThrown: 'SyntaxError: Unexpected token <'
responseText:

Parse error: syntax error, unexpected '{', expecting function (T_FUNCTION) in /home/hobbycha/public_html/store/override/controllers/front/CartController.php on line 6

 

 

I tried all the forum suggestions after searching the issues, disabling Ajax, disable PayPal, disabling the model that caused the issue, uninstalling the model. 

Nothing worked for me >.< 

 

I have turned off maintenance mode and I turned on error/debug report mode for your reference. 

store link: http://store.hobbychan.com

 

I couldn't get hold of the developer .. . 

Appreciate the support. 

 

One last thing, when trying to install the module again, i get this 

Parse error: syntax error, unexpected '{', expecting function (T_FUNCTION) in /home/hobbycha/public_html/store/classes/module/Module.php(2523) : eval()'d code on line 6

Parse error: syntax error, unexpected '{', expecting function (T_FUNCTION) in /home/hobbycha/public_html/store/classes/module/Module.php(2637) : eval()'d code on line 6

Fatal error: Uncaught exception 'ReflectionException' with message 'Class CartControllerOverrideOriginal_remove56a4d086a8abe does not exist' in /home/hobbycha/public_html/store/classes/module/Module.php:2638 Stack trace: #0 /home/hobbycha/public_html/store/classes/module/Module.php(2638): ReflectionClass->__construct('CartControllerO...') #1 /home/hobbycha/public_html/store/classes/module/Module.php(2482): ModuleCore->removeOverride('CartController') #2 /home/hobbycha/public_html/store/classes/module/Module.php(287): ModuleCore->uninstallOverrides() #3 /home/hobbycha/public_html/store/modules/belvg_preorderproducts/belvg_preorderproducts.php(84): ModuleCore->install() #4 /home/hobbycha/public_html/store/controllers/admin/AdminModulesController.php(846): Belvg_PreOrderProducts->install() #5 /home/hobbycha/public_html/store/controllers/admin/AdminModulesController.php(1094): AdminModulesControllerCore->postProcessCallback() #6 /home/hobbycha/public_html/store/classes/controller/Controller.php(171): AdminModulesControllerCor in /home/hobbycha/public_html/store/classes/module/Module.php on line 2638
[PrestaShop] Fatal error in module file :/home/hobbycha/public_html/store/classes/module/Module.php:
Uncaught exception 'ReflectionException' with message 'Class CartControllerOverrideOriginal_remove56a4d086a8abe does not exist' in /home/hobbycha/public_html/store/classes/module/Module.php:2638 Stack trace: #0 /home/hobbycha/public_html/store/classes/module/Module.php(2638): ReflectionClass->__construct('CartControllerO...') #1 /home/hobbycha/public_html/store/classes/module/Module.php(2482): ModuleCore->removeOverride('CartController') #2 /home/hobbycha/public_html/store/classes/module/Module.php(287): ModuleCore->uninstallOverrides() #3 /home/hobbycha/public_html/store/modules/belvg_preorderproducts/belvg_preorderproducts.php(84): ModuleCore->install() #4 /home/hobbycha/public_html/store/controllers/admin/AdminModulesController.php(846): Belvg_PreOrderProducts->install() #5 /home/hobbycha/public_html/store/controllers/admin/AdminModulesController.php(1094): AdminModulesControllerCore->postProcessCallback() #6 /home/hobbycha/public_html/store/classes/controller/Controller.php(171): AdminModulesControllerCor

Link to comment
Share on other sites

Hi, it seems the issue is an incomplete file.  When we see

Parse error: syntax error, unexpected '{', expecting function (T_FUNCTION) in /home/hobbycha/public_html/store/override/controllers/front/CartController.php on line 6

and then look at the file override/controllers/front/CartController.php  then I expect it is truncated and incomplete.

 

Then it appears than when you uninstalled, it could not remove the override.

 

You can remove override/controllers/front/CartController.php by 1) renaming by prefixing the name _CartController.php or 2) delete it and THEN

delete cache/class_index.php file.  

  • Like 1
Link to comment
Share on other sites

I can never thank you enough. 

I was struggling for two days to solve this! 

Thank you so much <3 

 

One last question: is it safe if I keep the error reporting switched on or shall I turn it off again? 

 

Thanks <3 

 

I am very happy to help..these things can be very stressful and there are 'many' hats one must wear when supporting an online presence.  The most important thing is having a rock solid back up restore, not via  back office but from hosting or other process.  Having capability to to roll back to working copy saves much stress.  Building a 'hidden' copy of your production shop to test new things is also good idea.

 

re. debug mode (error reporting) should never be enabled unless you are actively doing debug...never ever...

 

happy day, el

Link to comment
Share on other sites

THank you so much for the tips, I will be looking into that especially when having a shop with more than 500+ different products. 
One last thing and I really apologize for the trouble. 

I was "just to make sure" going through the entire website.

I noticed in the blog articles I get this error on the top of the page 

Warning: Invalid argument supplied for foreach() in /home/hobbycha/public_html/store/modules/stblog/controllers/front/article.php on line 125

 

Blog url: http://store.hobbychan.com/blog/9_hobby-chan-features-animeqtr.html

Link to comment
Share on other sites

THank you so much for the tips, I will be looking into that especially when having a shop with more than 500+ different products. 

One last thing and I really apologize for the trouble. 

 

I was "just to make sure" going through the entire website.

I noticed in the blog articles I get this error on the top of the page 

 

Warning: Invalid argument supplied for foreach() in /home/hobbycha/public_html/store/modules/stblog/controllers/front/article.php on line 125

 

Blog url: http://store.hobbychan.com/blog/9_hobby-chan-features-animeqtr.html

 

warning does not  stop execution of a php script..if no impact on feature then really no action required...my best  advice is for each new question, new topic so entire community can help.

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