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:
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 ?