Jump to content

Solved: Unable to Add Products to Cart (PrestaShop 1.7.8.7)


Recommended Posts

Posted (edited)

I currently run 1.7.8.7 .
Previously had an Insurance module installed which interfered with other modules so I uninstalled the insurance module.

Now I cannot add product to cart from the product page. I can add it from the category list but not the specific product page.

Server logs says problem with cart.php file in overrides , so I deleted it, problem still there.
I see there are still many cart related overrides listed, can I just delete those? I think they all related to the insurance module which was not working.

List of overrides:

    classes/PaymentModule.php
    classes/controller/FrontController.php
    classes/order/OrderDetail.php
    classes/order/Order.php
    classes/order/OrderPayment.php
    classes/Product.php
    controllers/front/ContactController.php
    controllers/front/CartController.php
    controllers/front/AuthController.php
    controllers/admin/AdminOrdersController.php
    modules/contactform/contactform.php
    modules/ps_shoppingcart/controllers/front/ajax.php
    modules/ps_shoppingcart/ps_shoppingcart.php

 

Edited by pietpetoors
Solved (see edit history)
Link to comment
Share on other sites

Posted (edited)
19479#0: *22064319 FastCGI sent in stderr: "PHP message: PHP Warning: Declaration of Ps_ShoppingcartOverride::renderModal(Cart $cart, $id_product, 
$id_product_attribute, $instructions_valid = NULL) should be compatible with Ps_Shoppingcart::renderModal($id_product, $id_product_attribute, 
$id_customization) in /var/www/vhosts/4x4direct.co.za/httpdocs/override/modules/ps_shoppingcart/ps_shoppingcart.php on line 0" while reading 
response header from upstream

 

Edited by pietpetoors (see edit history)
Link to comment
Share on other sites

Troubleshooting Your PrestaShop Cart Issue

1. Analyze the Error Message:

The error message "Declaration of Ps_ShoppingcartOverride::renderModal(...) should be compatible with Ps_Shoppingcart::renderModal(...)" indicates a conflict between the original function in the ps_shoppingcart module and an override you have in place. This override likely originated from the uninstalled insurance module.

2. Identify Remaining Overrides:

Although you deleted the cart.php override, the message suggests there might be other overrides related to the insurance module. From the list you provided, focus on these related to the cart functionality:

modules/ps_shoppingcart/controllers/front/ajax.php
modules/ps_shoppingcart/ps_shoppingcart.php
classes/CartController.php

3. Address the Overrides:
Instead of blindly deleting all overrides, try these steps:

Disable Overrides: Go to Advanced Parameters > Performance and disable the option "Compile overrides." This will temporarily disable all overrides. See if adding products to the cart works. If it does, then the issue lies with an override.

Review and Clean Overrides: If disabling helps, re-enable overrides and open the mentioned override files (ajax.php, ps_shoppingcart.php, and CartController.php). Look for any code related to the uninstalled insurance module and remove it.

Clear Cache: After any changes to overrides, clear your PrestaShop cache to ensure the changes take effect.

4. Check for Theme Conflicts (Optional):

If the above steps don't resolve the issue, consider a theme conflict. Try switching to the default PrestaShop theme and see if the cart functionality works. If it does, then there might be an issue with your custom theme's files interacting with the cart functionality.

Additional Tips:

Backup: Before making any changes, always back up your PrestaShop files and database.
Version Compatibility: Ensure all your modules (including ps_shoppingcart) are compatible with PrestaShop 1.7.8.7.

By following these steps and considering the additional tips, we hope you will be able to diagnose and fix the issue.

Good day

Link to comment
Share on other sites

Thank you, if I disable overrides in Advanced Parameters the problem is still there.
I did try to switch to default theme, Classic Version 1.0.0 , but if I enable none of my products, menus or anything shows up, so I cannot see a product which I can open and test.

Link to comment
Share on other sites

BUT you did direct me on the correct path with the Theme, thank you!
From the Theme's orginal files I re-uploaded the files in ps_shoppingcart and ps_viewedproduct and now it is working correctly again.

  • Like 1
Link to comment
Share on other sites

Posted (edited)

To help other merchants facing a similar issue, it would be fantastic if you could update the forum topic title to 'Solved: Unable to Add Products to Cart (PrestaShop 8.1.3)'.

This way, other users encountering the same problem can easily identify this thread as a solution source.

Thanks

Edited by PrestaServicePro (see edit history)
Link to comment
Share on other sites

  • pietpetoors changed the title to Solved: Unable to Add Products to Cart (PrestaShop 1.7.8.7)

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