nicoledesignstore Posted April 28, 2022 Share Posted April 28, 2022 (edited) As per subject, I would like to know where Prestashop storages the lastly generated unique cart id that the new cart controller utilizes to create a new cart id as soon as a new visitor presses "add to cart" and how, if possible, to modify it with a custom one. This information is needed to avoid an after 1.6 to 1.7 migration conflict that causes the cart not being generated at first customer's "add to cart" click (hence with modal appearing with a "0" amount counted and no products effectively added) due to the id_cart being already used for previously received orders. Another solution I found to be working fine is changing all the pre-existing order column id_cart in ps_orders table to cart id 1, but i think setting a grater number id as starting point (for example 50000) for new carts to be generated is a cleaner and smarter solution. Thanks Edited April 28, 2022 by nicoledesignstore (see edit history) Link to comment Share on other sites More sharing options...
knacky Posted April 28, 2022 Share Posted April 28, 2022 Prestashop finds the sql query last id_cart and adds +1. Id_cart is defined as AUTO_INCREMENT in the ps_cart table. So just change the starting number in the database. ALTER TABLE ps_cart AUTO_INCREMENT = 50000 Link to comment Share on other sites More sharing options...
knacky Posted April 28, 2022 Share Posted April 28, 2022 You can do the same with the numbering of orders and invoices. E.g.: ALTER TABLE ps_orders AUTO_INCREMENT = 50000 1 Link to comment Share on other sites More sharing options...
nicoledesignstore Posted April 28, 2022 Author Share Posted April 28, 2022 Hi @knacky! Thanks a lot for that suggestion, that was indeed the solution or, at least, fo now the one that works! As of now I am testing possible other conflicts. again, thanks for the contribution. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now