clayton29657 Posted October 26, 2012 Share Posted October 26, 2012 Ok everyone I have read so many topics here in the forums and everyone has used different ways to delete test orders from their databases so with that being said can someone please give me the correct way of doing this. If you do not know for a fact please do not answer. I need someone that has developer exp. here with prestashop because I am not going to screw my database up. Thanks in advance Clayton Link to comment Share on other sites More sharing options...
rturner Posted October 27, 2012 Share Posted October 27, 2012 I know there are free and paid modules that make it easy, but without all that, it's really very simple. Go into your backoffice, click on Orders. Then click on a test order to view it. If you look up into your browser's address bar there is a long address there. You will see that vieworder is part of that long address. Just change vieworder to deleteorder and hit Enter. Bingo, test order is gone. 2 Link to comment Share on other sites More sharing options...
clayton29657 Posted October 27, 2012 Author Share Posted October 27, 2012 Thank you rturner for the feedback. I read that this method caused many issues with the database is that correct? Link to comment Share on other sites More sharing options...
rturner Posted October 27, 2012 Share Posted October 27, 2012 I've been doing it on several stores for months with no apparent database problems. It never hurts to backup the database. Link to comment Share on other sites More sharing options...
clayton29657 Posted October 27, 2012 Author Share Posted October 27, 2012 thank you sir for the reply. May I ask do you have to do this per test order? I have deleted some a long time ago just in the back office is why I am asking or trying to find out after realizing that this had to be done Link to comment Share on other sites More sharing options...
bellini13 Posted October 27, 2012 Share Posted October 27, 2012 the issue with using the method above is 2 fold 1) it does not remove all traces of the order from the database. It only removes the main order information, however information about which products were a part of the order remains in the database 2) if the order that you delete was the most recent order, then when a new order arrives, the products from the deleted order will be combined with the new order. So if you do not care about leaving behind those traces, AND you can manage to not delete the most recent order, then you technically should be fine. Link to comment Share on other sites More sharing options...
clayton29657 Posted October 27, 2012 Author Share Posted October 27, 2012 So if all orders have been deleted it will carry over to the invoice for a live customer? Will this continue on for the life of the site or just for the 1st time. That will not be good if it does carry over seeing my items are pet store. I need it to start fresh. Link to comment Share on other sites More sharing options...
bellini13 Posted October 28, 2012 Share Posted October 28, 2012 oh, if you are deleting all your test orders, then it would effect more than the first order the reason for this, is Prestashop will re-use the id_order, essentially restarting at one. So if you had 5 test orders, whose id_order was 1 through 5, then the first 5 orders will take on the products from the old 5 test orders. as others have mentioned, there are modules to delete orders. I suggest you do some research to find one, like this... http://www.prestashop.com/forums/topic/191037-free-delete-orders-module/ Link to comment Share on other sites More sharing options...
clayton29657 Posted October 28, 2012 Author Share Posted October 28, 2012 Ok that makes more sense now. I am ok with this I will just have my regular customers make the 1st orders on the site so they will know what's going on thank you Link to comment Share on other sites More sharing options...
El Patron Posted October 28, 2012 Share Posted October 28, 2012 IMHO the following would be the correct way. WARNING: if you have any 'other' modules that build their own information from orders..the results can be unpredictable and...you should back up your db before deleting any orders. admingfolder/tabs/AdminOrders.php add this line of code: $this->delete = true; then visit your admin orders tab, you will then see the delete trashcan... public function __construct() { $this->delete = true; } 2 Link to comment Share on other sites More sharing options...
clayton29657 Posted October 28, 2012 Author Share Posted October 28, 2012 thank you that's what I am looking for Link to comment Share on other sites More sharing options...
El Patron Posted October 28, 2012 Share Posted October 28, 2012 con mucho gusto Link to comment Share on other sites More sharing options...
vynx Posted October 28, 2012 Share Posted October 28, 2012 IMHO the following would be the correct way. WARNING: if you have any 'other' modules that build their own information from orders..the results can be unpredictable and...you should back up your db before deleting any orders. admingfolder/tabs/AdminOrders.php add this line of code: $this->delete = true; then visit your admin orders tab, you will then see the delete trashcan... public function __construct() { $this->delete = true; } how about PS 1.5.x ? it is possible? Link to comment Share on other sites More sharing options...
El Patron Posted October 28, 2012 Share Posted October 28, 2012 how about PS 1.5.x ? it is possible? controllers/admin/AdminOrdersController.php change the $this->deleted = false; to true... Note: not tested... Link to comment Share on other sites More sharing options...
vynx Posted October 28, 2012 Share Posted October 28, 2012 controllers/admin/AdminOrdersController.php change the $this->deleted = false; to true... Note: not tested... i try then the result page become blank ... not working ... Link to comment Share on other sites More sharing options...
clayton29657 Posted October 28, 2012 Author Share Posted October 28, 2012 (edited) this is the exact reason I opened this post because I never could get a true grasp on what was the correct way but I am not saying none of the ways are wrong by any means. I use 1.4.9 and will try elpatrons way and no, I do not use any other modules to delete test orders now. I am trying to keep modules to a minimum if I can help it only cause there's always so many updates and it will really become a pain in the you know what lol. Thank you all for all the feedback as it has been very helpful Edited October 28, 2012 by clayton29657 (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted October 28, 2012 Share Posted October 28, 2012 using the delete trash can or just entering the deleteorders in the URL equate to the same thing, and will result in orphaned records. you either need skills and knowledge with the database to correctly delete all orders, or just use a module that already provides that functionality. 1 Link to comment Share on other sites More sharing options...
clayton29657 Posted October 28, 2012 Author Share Posted October 28, 2012 I have seen so many modules that 3rd party developers make for this so can you all give me one that you know will work. I have some techs at my disposal to work on my site. I just want to know what can or can't be done before i approach them with this issue. Thank you bellini13 you're always a huge help and asset to the forums Link to comment Share on other sites More sharing options...
bellini13 Posted October 29, 2012 Share Posted October 29, 2012 you just have to pick one and try it Link to comment Share on other sites More sharing options...
B@ndit Posted March 2, 2013 Share Posted March 2, 2013 Thanks for this, really helped me out! Link to comment Share on other sites More sharing options...
guest* Posted April 8, 2013 Share Posted April 8, 2013 @ B@andit - You are using Prestashop 1.5.4. ? There is a new module in this version named "Prestashop Cleaner" with this module you can delete all demos. Link to comment Share on other sites More sharing options...
Housy Posted October 25, 2013 Share Posted October 25, 2013 (edited) I use a free module to do this and everything works fine but the only problem for me is, that if i made 20 test orders for example and i delete them all, the new order ID number won't start with 1 again but 21 instead. Is there a way to solve this somehow? I'd like my orders to start with #1 again. Thank you and best regards, Housy Edited October 25, 2013 by Housy (see edit history) Link to comment Share on other sites More sharing options...
Housy Posted October 25, 2013 Share Posted October 25, 2013 (edited) Well, here is a solution Just go to your phpmyadmin, find table "ps_order" and "ps_order_details", truncate both and you're new orders will begin with number #1 again. Hope this helps I use a free module to do this and everything works fine but the only problem for me is, that if i made 20 test orders for example and i delete them all, the new order ID number won't start with 1 again but 21 instead. Is there a way to solve this somehow? I'd like my orders to start with #1 again. Thank you and best regards, Housy Edited October 25, 2013 by Housy (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted October 25, 2013 Share Posted October 25, 2013 except that there are still ghost records in other tables, so when you re-create orders starting from 1 again, you will eventually have these ghost records joined to these new orders... that would likely not turn out well Link to comment Share on other sites More sharing options...
Housy Posted October 25, 2013 Share Posted October 25, 2013 Which tables should i truncate beside those two, so i would avoid problems? except that there are still ghost records in other tables, so when you re-create orders starting from 1 again, you will eventually have these ghost records joined to these new orders... that would likely not turn out well Link to comment Share on other sites More sharing options...
msg2nirmal Posted April 3, 2019 Share Posted April 3, 2019 just add this code in controllers/admin/AdminOrdersController.php inside the __construct() function. $this->addRowAction('delete'); before this code -> parent::__construct(); thanks 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