xderia Posted April 13, 2015 Share Posted April 13, 2015 When a customer makes an order, say for productA and the cost is 100. In my order view, its like this: ProductA = 100 ProductB = 300 Total=100 Why is the ProductB added for no reason? Its very creazy! How can I fix this? I did try to upgrade from 1.6.0.9 to 1.6.0.14, but the problem is still there. Also many order statuses are auto added. Please see attachments. Please help. Site: http://www.speedwave.no/ Link to comment Share on other sites More sharing options...
PascalVG Posted April 13, 2015 Share Posted April 13, 2015 (edited) Hi xderia, Can it be that you deleted some old (try out/demo) orders from your database lately? Sometimes the database doesn't get fully cleaned when deleting orders More info on it here: https://www.prestashop.com/forums/topic/242031-solved-an-extra-product-appears-in-my-customers-shopping-cart/ To quickly check if this is indeed the problem, do this: Go to your cPanel and open phpMyAdmin. Logon to your Prestashop database Go to table ps_orders Go to the very last row in the order table (Be careful, sometimes there are more pages and it shows only a small part on one page, so go to the last page and there look at the last item). Check the id_order of the last item and remember this number. Then go to the ps_order_detail page and do the same, go to the last page, last row and there check the 2nd column (with name id_order, NOT id_order_detail) Check the number and compare to the id_order of the ps_order table. Is the one in ps_order_detail higher? Then indeed this is the problem. So, knowing this, then what... I think the easiest way to solve it is: 1) BACKUP your database, just in case!!! We're going to hack in it, and anything going wrong can make the database unusable. so, BACKUP!!! Best to backup the whole database using cPanel->phpMyAdmin. 2) What we are going to do is increase the auto-increment start number of the order table to a higher number. ALTER TABLE ps_orders AUTO_INCREMENT = XXX; (N.B. if you use another prefix than ps_ for your tables, change accordingly ) We found out the highest number of id_order in the ps_order_detail table already. In the ps_order table we want to tell the table manager to continue with auto-incrementing the id_order starting at the highest id_order number found +1 So what we do: ALTER TABLE ps_orders AUTO_INCREMENT = <highest number of id_order of ps_order_detail + 1>; So, if the id_order on the last row of ps_order_detail was 145 it will be: ALTER TABLE ps_orders AUTO_INCREMENT = 146; To run this command, go to your phpMyAdmin, go to your database -> ps_orders table, click on the SQL tab and add this command to the text box. Then press the GO button. You should get some confirmation that all went ok. To check if all is ok now, go to the structure tab, and scroll all the way down. There you see an information box with an item: Next autoindex. This should now be the number we used in the command (146 in the sample) Hope this does the trick. pascal. Edited April 13, 2015 by PascalVG changed ps_order to ps_orders (see edit history) Link to comment Share on other sites More sharing options...
xderia Posted April 13, 2015 Author Share Posted April 13, 2015 Thanks!! Please see attachments and confirm. Link to comment Share on other sites More sharing options...
xderia Posted April 13, 2015 Author Share Posted April 13, 2015 Check these files. Link to comment Share on other sites More sharing options...
PascalVG Posted April 13, 2015 Share Posted April 13, 2015 Hi xderia, If I see your first two pictures with the auto-increments, they seems to be OK (ps_order should start at 13, as last id_order in both tables are 12). the 22 in your first image is NOT the id_order, but the auto-increment for the id_order_detail, which is not the same. Just leave this one at 22. So, although you did delete some orders, the current auto-increment stays at 13, which is good. What was the id_order of the order which had problems with these extra products you talked about in the first post? Can you check if in ps_order_detail these extra products are also mentioned for any the order rows which have that id_order (I expect id_order = 12)? If it was a left over of a deleted order, it must have been that you deleted the last order, which then, afterwards, was re-used (i.e order with id_order = 12). As the auto-increment is now at 13, you should not get more problems like this. However, make sure you don't delete orders, but just give them status 'canceled' instead. Let me know if the order which gave problems was indeed order number with id_order = 12. pascal. 1 Link to comment Share on other sites More sharing options...
xderia Posted April 13, 2015 Author Share Posted April 13, 2015 Thanks!!!! Please see attachment and comment. And yes, the auto added products and auto added order statuses are from deleted orders with this module: "Delete orders v2.0 - av RSI - Enable delete button in order page - www.catalogo-onlinersi.com.ar" How can I fix this? Link to comment Share on other sites More sharing options...
PascalVG Posted April 13, 2015 Share Posted April 13, 2015 I believe you can just remove the row in ps_order_detail that has the non-desired product on it. That should fix the order (no 11) I'm surprised that the module doesn't take care of all tables correctly. Maybe mention this thread to them and tell them to fix it. :-) Please double-check after deleting the row with the 'ghost product' if the auto-increment for the table ps_order_detail is indeed still equal to (highest d_product_detail + 1 = 22) Succes! pascal 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