Hi,
It seems to be an issue with the database.
I've added some debug in administrator/components/com_hikashop/helpers/helper.php in the save function which handles adding and updating elements to the database.
I've made it so that it logs any insert MySQL query (for new elements, like a new cart), then, logs the result of the MySQL query, and finally logs the id resulting.
So the code is basically like this:
hikashop_writeToLog($query);
$this->database->setQuery($query);
$status = $this->database->execute();
hikashop_writeToLog($status);
...
$id = $this->database->insertid();
hikashop_writeToLog('last id:'.$id);
At the end of your HikaShop log, I get this when I do an add to cart:
<h3>01.05.23 15:17:45</h3>
INSERT IGNORE INTO `#__hikashop_cart` ( `user_id`,`session_id`,`cart_currency_id`,`cart_params`,`cart_share`,`cart_type`,`cart_current`,`cart_modified` ) VALUES ( '0','d414eb9a9651a1b8955de04281319d85','4','{}','nobody','cart','1','1672931865' )
<h3>01.05.23 15:17:45</h3>
1
<h3>01.05.23 15:17:45</h3>
last id:0
So first the MySQL query is correct. And if I run it in your PHPMyAdmin (after changing the prefix), I do get the cart entry added in the hikashop_cart table.
Then, the "1" indicates that MySQL successfully executed the query.
But the "last id:0" means that MySQL returned 0 instead of the cart_id of the new cart.
This could indicate that the hikashop_cart table is missing the primary key / auto_increment.
So I checked that table in your PHPMyAdmin but I can see the primary key on cart_id and the auto_increment on it:
i.imgur.com/FS3wNQH.png
What's strange is that the entry in the hikashop_cart table has not been added, even though the execute function returned a success.
Now, looking a bit online about this, I found this:
joomla.stackexchange.com/questions/5754/...ast-inserted-id/5768
It seems to match with the situation. However, in these cases, the entry is added in the database, which isn't the case on your end.
Also, it could potentially be a system plugin which would override the Joomla MySQL driver to run a SELECT query right after the INSERT query for some reason, leading to the insertid() function to fail. I know Falang has a driver override working in a similar way (but it doesn't cause issues because it only works on SELECT queries, not UPDATE or INSERT queries). However, I couldn't find a plugin which looked suspicious on your website regarding this.
So basically, I'm not sure what is the problem. It seems to be linked to the configuration of your database, but I'm not sure what it could be. I would recommend checking with your hosting support.
Also, if you can make a copy of the website on another hosting (or a local XAMP), you could verify that everything still works fine, which would confirm that it comes from something on the server side.