simpson7647 Posted January 19, 2012 Share Posted January 19, 2012 hi all, ive had a few orders but since re-stocking, i'm looking to delete the orders that are currently in the database. How could I do this please? Thanks, Link to comment Share on other sites More sharing options...
tomerg3 Posted January 20, 2012 Share Posted January 20, 2012 See http://www.projectamplify.com/reset-prestashop-following-testing.html If you want to only delete the orders, just run the queries with the word order or cart. Link to comment Share on other sites More sharing options...
El Patron Posted January 20, 2012 Share Posted January 20, 2012 or, and I don't recommend this after you have established your shop. in your admin folder/AdminOrders.php class AdminOrders extends AdminTab { public function __construct() { global $cookie; $this->table = 'order'; $this->className = 'Order'; $this->view = true; $this->colorOnBackground = true; $this->delete = true; add the last line '$this->delete = true;' then go to your orders, and you will see the trashcan 1 Link to comment Share on other sites More sharing options...
simpson7647 Posted January 20, 2012 Author Share Posted January 20, 2012 or, and I don't recommend this after you have established your shop. in your admin folder/AdminOrders.php class AdminOrders extends AdminTab { public function __construct() { global $cookie; $this->table = 'order'; $this->className = 'Order'; $this->view = true; $this->colorOnBackground = true; $this->delete = true; add the last line '$this->delete = true;' then go to your orders, and you will see the trashcan Thanks for the replies, Regarding this, the website isnt really established as I've only been trading through ebay and had a couple of sales through the website with some test orders there. So I'm looking to delete the orders so the website can start from fresh. Link to comment Share on other sites More sharing options...
El Patron Posted January 20, 2012 Share Posted January 20, 2012 how do you delete all products and start freash? see the posts above by tomerg3 and myself. These are the only two viable ways to delete orders. Both are a 'little' technical, there are no other easier methods. Link to comment Share on other sites More sharing options...
simpson7647 Posted January 20, 2012 Author Share Posted January 20, 2012 or, and I don't recommend this after you have established your shop. in your admin folder/AdminOrders.php class AdminOrders extends AdminTab { public function __construct() { global $cookie; $this->table = 'order'; $this->className = 'Order'; $this->view = true; $this->colorOnBackground = true; $this->delete = true; add the last line '$this->delete = true;' then go to your orders, and you will see the trashcan Thanks but where do i find the admin orders? Thanks, Link to comment Share on other sites More sharing options...
El Patron Posted January 21, 2012 Share Posted January 21, 2012 in your admin folder/AdminOrders.php Link to comment Share on other sites More sharing options...
appliedcolors Posted January 21, 2012 Share Posted January 21, 2012 Well, you must have admin rights to do this like data base excess and server passwords. Paintless Dent Removal Training Link to comment Share on other sites More sharing options...
El Patron Posted January 21, 2012 Share Posted January 21, 2012 Well, you must have admin rights to do this like data base excess and server passwords. Paintless Dent Removal Training just ftp Link to comment Share on other sites More sharing options...
Carolina Custom Designs Posted January 21, 2012 Share Posted January 21, 2012 If you have a bunch of orders to delete I recommend running a query on your database to delete the orders (as tomer suggested) but if you only have a couple of orders and don't really understand how to run queries on databases then I suggest you use elpatron's method. To be a little more specific the file you will be looking for is found in youradminfolder/tabs/AdminOrders.php. I would suggest that you remove the line of code after deleting the orders. Marty Shue Link to comment Share on other sites More sharing options...
vasvra Posted January 21, 2012 Share Posted January 21, 2012 I took Tomerg3 suggestion to run the SQL , copied from the site and when I run it I get a 1064 syntax error. Can somebody tell me where I went wrong? I run the follow: TRUNCATE TABLE `ps_customer`; TRUNCATE TABLE `ps_customer_group` TRUNCATE TABLE `ps_address`; TRUNCATE TABLE `ps_orders`; TRUNCATE TABLE `ps_order_detail`; TRUNCATE TABLE `ps_order_discount`; TRUNCATE TABLE `ps_order_history`; TRUNCATE TABLE `ps_message`; TRUNCATE TABLE `ps_cart`; TRUNCATE TABLE `ps_cart_product`; TRUNCATE TABLE `ps_cart_discount`; Link to comment Share on other sites More sharing options...
simpson7647 Posted January 22, 2012 Author Share Posted January 22, 2012 Thanks, works treat. Link to comment Share on other sites More sharing options...
TWDesign Posted June 22, 2012 Share Posted June 22, 2012 (edited) I took Tomerg3 suggestion to run the SQL , copied from the site and when I run it I get a 1064 syntax error. Can somebody tell me where I went wrong? I run the follow: TRUNCATE TABLE `ps_customer`; TRUNCATE TABLE `ps_customer_group` TRUNCATE TABLE `ps_address`; TRUNCATE TABLE `ps_orders`; TRUNCATE TABLE `ps_order_detail`; TRUNCATE TABLE `ps_order_discount`; TRUNCATE TABLE `ps_order_history`; TRUNCATE TABLE `ps_message`; TRUNCATE TABLE `ps_cart`; TRUNCATE TABLE `ps_cart_product`; TRUNCATE TABLE `ps_cart_discount`; Missing semi-colon at end of the second line most probably. fyi You might also want to check your table prefix. In the older versions of PrestaShop, tables began with "ps_" as shown above. In later versions I believe they have changed to "pr_" so just check it and change the above query accordingly. Edited June 22, 2012 by TWDesign (see edit history) Link to comment Share on other sites More sharing options...
TWDesign Posted July 31, 2012 Share Posted July 31, 2012 I just noticed that I still have Vouchers from Test Orders. Which tables should I TRUNCATE to remove any legacy Vouchers? Also Loyalty Points? Link to comment Share on other sites More sharing options...
Carolina Custom Designs Posted August 30, 2012 Share Posted August 30, 2012 We have a module that will allow you to do this quickly and easily http://shop.carolinacustomdesigns.com/13-t.html Marty Shue Link to comment Share on other sites More sharing options...
subulica Posted September 30, 2012 Share Posted September 30, 2012 hi all, ive had a few orders but since re-stocking, i'm looking to delete the orders that are currently in the database. How could I do this please? Thanks, Option 2: For the sake of PHP Go to AdminOrders.php class in admin\tabs\AdminOrders.php At line 25 look for global $cookie, $currentIndex; And add this at line 32 $this->delete = true; Link to comment Share on other sites More sharing options...
bjp Posted October 5, 2012 Share Posted October 5, 2012 We have a module that will allow you to do this quickly and easily http://shop.carolina...s.com/13-t.html Marty Shue Will this module let me clean up Stock Movement? I don't see that mentioned in the description. bjp Link to comment Share on other sites More sharing options...
nspinheiro Posted November 15, 2012 Share Posted November 15, 2012 Option 2: For the sake of PHP Go to AdminOrders.php class in admin\tabs\AdminOrders.php At line 25 look for global $cookie, $currentIndex; And add this at line 32 $this->delete = true; I can't find AdminOrders.php on my ftp, maybe it's because of the version of PS? Mine is 1.5.1. Does anyone know if it is anywhere else? Thanks Link to comment Share on other sites More sharing options...
jensen_tw Posted November 18, 2012 Share Posted November 18, 2012 I do not find it either. PS 1.5.2 where is it ? Link to comment Share on other sites More sharing options...
TWDesign Posted January 6, 2013 Share Posted January 6, 2013 (edited) We have a module that will allow you to do this quickly and easily http://shop.carolina...s.com/13-t.html Marty Shue http://prestashop.carolinacustomdesigns.com/administration/27-tabula-rasa.html When can we expect a PS 1.5 release of this module? Thanks Edited January 6, 2013 by TWDesign (see edit history) Link to comment Share on other sites More sharing options...
Carolina Custom Designs Posted January 7, 2013 Share Posted January 7, 2013 http://prestashop.ca...abula-rasa.html When can we expect a PS 1.5 release of this module? Thanks I wish I had an answer for that. Right now with our current project load it has been slow going on upgrading the existing modules. We have a few very exciting modules under development that will be released soon on our module store. 1.5.x compatible modules will also be posted on our website. Marty Shue Link to comment Share on other sites More sharing options...
Rahvin Posted March 8, 2013 Share Posted March 8, 2013 (edited) I took Tomerg3 suggestion to run the SQL , copied from the site and when I run it I get a 1064 syntax error. Can somebody tell me where I went wrong? I run the follow: TRUNCATE TABLE `ps_customer`; TRUNCATE TABLE `ps_customer_group` TRUNCATE TABLE `ps_address`; TRUNCATE TABLE `ps_orders`; TRUNCATE TABLE `ps_order_detail`; TRUNCATE TABLE `ps_order_discount`; TRUNCATE TABLE `ps_order_history`; TRUNCATE TABLE `ps_message`; TRUNCATE TABLE `ps_cart`; TRUNCATE TABLE `ps_cart_product`; TRUNCATE TABLE `ps_cart_discount`; Deleting test-orders is really really really annoying in Prestashop! I've be looking for a 'clean' solution for what feels like a week now but without success. I'd like to have a clean database and no corrupt data so I don't want the solution with editing the Admin-Controller or use the URL-One-Liner. I thought it would be a good idea to use some of the modules arround but sorry, I've tried three and they were all crap. None of theme deleted all tables, every single module missed the one or the other table. Finally I have decided to write a module for myself or to write a small sql-function. I just like to know if I have missed any table for this issue. Is there any full list of all tables that are storing order-data for Presta-Shop 1.5.3? If I am right this should be following tables: ps_orders ps_order_carrier ps_order_cart_rule ps_order_detail ps_order_detail_tax ps_order_history ps_order_invoice ps_order_invoice_payment ps_order_invoice_tax ps_order_message ps_order_message_lang ps_order_payment ps_order_return ps_order_return_detail ps_order_slip ps_order_slip_detail I'm not sure about these ones: ps_order_return_state ps_order_return_state_lang ps_order_state ps_order_state_lang Any help and/or comments are greatly welcome Edited March 8, 2013 by Rahvin (see edit history) Link to comment Share on other sites More sharing options...
maio Posted July 17, 2013 Share Posted July 17, 2013 ps_order_return_state ps_order_return_state_lang ps_order_state ps_order_state_lang these tables refer to the order state, if you haven't added information with your own tests, by default non demo-order information is contained. Link to comment Share on other sites More sharing options...
Recommended Posts