Jump to content

Prestashop 8.03 error adding to cart


Recommended Posts

While I was configuring my new Prestashop 8.03 (new installation, not update) at some point the add to cart action stopped working, or adjust the number of products I want to add to the cart. PHP  8.0.28 

On the product page when I press the add to cart button, or when I change the number of items I want to add to the cart, I get this error:

935242001.jpg.4df1c1a99da47e0329627174ca869214.jpg

The product is added to the cart but the page is left thinking, something does not work well with ajax

I am using the latest version Wharehouse theme, but the same thing also happens with the classic theme. I have disabled all non-native modules, and a friendly url module that I use. But it keeps giving error.

In the log files, this is recorded every time I add a product to the cart:

------------------------------------------------------------------------------------------------------------------------

[24-Apr-2023 19:33:29] WARNING: [pool mydomain.eu] child 2418136 said into stderr: "PHP message: PHP Warning:  Undefined array key 0 in /var/www/vhosts/mydomain.eu/httpdocs/override/classes/Link.php on line 118"
[24-Apr-2023 19:33:29] WARNING: [pool mydomain.eu] child 2418136 said into stderr: "PHP message: PHP Fatal error:  Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, PrestaShop\PrestaShop\Adapter\Presenter\Product\ProductLazyArray given in /var/www/vhosts/mydomain.eu/httpdocs/controllers/front/ProductController.php:517"
[24-Apr-2023 19:33:29] WARNING: [pool mydomain.eu] child 2418136 said into stderr: "Stack trace:"
[24-Apr-2023 19:33:29] WARNING: [pool mydomain.eu] child 2418136 said into stderr: "#0 /var/www/vhosts/mydomain.eu/httpdocs/override/controllers/front/ProductController.php(247): ProductControllerCore->getMinimalProductOrDeclinationQuantity()"
[24-Apr-2023 19:33:29] WARNING: [pool mydomain.eu] child 2418136 said into stderr: "#1 /var/www/vhosts/mydomain.eu/httpdocs/classes/controller/Controller.php(334): ProductController->displayAjaxRefresh()"
[24-Apr-2023 19:33:29] WARNING: [pool mydomain.eu] child 2418136 said into stderr: "#2 /var/www/vhosts/mydomain.eu/httpdocs/classes/Dispatcher.php(510): ControllerCore->run()"
[24-Apr-2023 19:33:29] WARNING: [pool mydomain.eu] child 2418136 said into stderr: "#3 /var/www/vhosts/mydomain.eu/httpdocs/index.php(28): DispatcherCore->dispatch()"
[24-Apr-2023 19:33:29] WARNING: [pool mydomain.eu] child 2418136 said into stderr: "#4 {main}"
[24-Apr-2023 19:33:29] WARNING: [pool mydomain.eu] child 2418136 said into stderr: "  thrown in /var/www/vhosts/mydomain.eu/httpdocs/controllers/front/ProductController.php on line 517"

------------------------------------------------------------------------------------------------------------------------------

However, when I go to the cart page to see the summary of my purchase, there I can modify the quantities of the added products and this error does not appear. It's only on the product page. Some help ?

 

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

You have some errors in overrides (probably installed by some module). Check with the module developer

2 hours ago, pikasso72 said:

override/classes/Link.php on line 118

2 hours ago, pikasso72 said:

override/controllers/front/ProductController.php

 

Link to comment
Share on other sites

I have found the problem and it is a bug of the Wharehouse theme, attached image.

935242001.jpg.d7db4d1d252243158606b0659241a470.jpg

This option should be set to "NO" if you are not using attributes or combinations.

The problem is that if the product does not have attributes, after adding to the cart it is left wondering if the option "Combination loading" is activated in the Wharehouse configuration

 

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