debugginglife Posted November 16, 2008 Share Posted November 16, 2008 Hi,I set up prestashop and modified according to the needs of our business. However, during modification i made too many test orders (more than 100). Thus, i want to delete orders without any trace or causing misbehavior in scripts. Database index number can be at its last value there is no problem with index. Could you offer me a way ?Regards,Ali 1 Link to comment Share on other sites More sharing options...
debugginglife Posted November 21, 2008 Author Share Posted November 21, 2008 I have been looking for an answer from an expert 1 1 Link to comment Share on other sites More sharing options...
Matthieu Biart Posted November 21, 2008 Share Posted November 21, 2008 Hi debugginglife!We already replied thousand of time to that question.Please do a search inside the forum. Link to comment Share on other sites More sharing options...
debugginglife Posted November 21, 2008 Author Share Posted November 21, 2008 Hi,As a conclusion from the previous messages, it is obvious that there is no X button for deleting order in back office. However, i am looking for some database editing ( with a tool like phpmyadmin or else), here can be some experts who did such changes before. If i delete both customer and its orders from database, will the script misbehave? Not being able to delete an order is a good feature to prevent the store form theft or lose of information, but there could be a manual method to remove test orders or bad orders ( like orders from some hacking attempts) 1 Link to comment Share on other sites More sharing options...
spott Posted November 23, 2008 Share Posted November 23, 2008 First - all orders need to stored! This is like accounting program, where You need to store all information. When You don't need this order, then You can cancel that.But when You still want delete orders - then You can do that at database. Look tables orders and order* tables. Link to comment Share on other sites More sharing options...
macandcheese Posted November 25, 2008 Share Posted November 25, 2008 i want to delete test orders too. .what table in mysql?? Link to comment Share on other sites More sharing options...
d0m1n1k Posted November 26, 2008 Share Posted November 26, 2008 delete from ps_cart; delete from ps_cart_product; delete from ps_message; delete from ps_order_detail; delete from ps_order_history; delete from ps_orders; i'm not responsible if it doesn't work as expected.you must create a DB backup before executing this sql commands.but:worked for me Link to comment Share on other sites More sharing options...
Popular Post kyrre Posted January 30, 2009 Popular Post Share Posted January 30, 2009 Hi debugginglife!We already replied thousand of time to that question.Please do a search inside the forum. Sorry for bringing up this old thread - but I just had to comment.You say "thousand of time"? That's the overstatement of the decade. I search for "delete order" and got 72 hits - and four of them was directly related to my search.If only people who know where to find information replyed, the web would be faster. If you don't have anything useful to say - don't say it!The challenge with forums like this is that there are people from all over the world using it. The spoken languages are many, and not all understand or writes english (or french for that matter) that well - me included!A little help and understanding is all that is needed for people to smile. And this software is all about smiling, because it's GREAT! 42 1 2 Link to comment Share on other sites More sharing options...
MahmutGulerce Posted May 23, 2009 Share Posted May 23, 2009 u can use this sql querry but before that you must create a backup TRUNCATE `ps_orders`; TRUNCATE `ps_order_customization_return`; TRUNCATE `ps_order_detail`; TRUNCATE `ps_order_discount`; TRUNCATE `ps_order_history`; TRUNCATE `ps_order_message`; TRUNCATE `ps_order_message_lang`; TRUNCATE `ps_order_return`; TRUNCATE `ps_order_return_detail`; TRUNCATE `ps_order_return_state`; TRUNCATE `ps_order_return_state_lang`; TRUNCATE `ps_order_slip`; TRUNCATE `ps_order_slip_detail`; TRUNCATE `ps_order_state`; TRUNCATE `ps_order_state_lang`; warning this deletes all orders and dont expand which is real order which is for test. Link to comment Share on other sites More sharing options...
shaiss Posted August 5, 2009 Share Posted August 5, 2009 Thank you mahmutta, that worked for me!After going back to do some more test orders I received "invalid order state" in the store front, and no orders show in the BO.Thats because the SQL query above empties 2 important tables TRUNCATE `ps_order_state`; TRUNCATE `ps_order_state_lang`; I'm still testing this, but I'd also add the below to the query above TRUNCATE `ps_message`; And remember if you get a mysql error, check your table prefix! Link to comment Share on other sites More sharing options...
shaiss Posted August 5, 2009 Share Posted August 5, 2009 Sorry for a duplicate post, but heres the SQL query that does work, tested 10 times over TRUNCATE `ps_orders`; TRUNCATE `ps_order_customization_return`; TRUNCATE `ps_order_detail`; TRUNCATE `ps_order_discount`; TRUNCATE `ps_order_history`; TRUNCATE `ps_order_message`; TRUNCATE `ps_order_message_lang`; TRUNCATE `ps_order_return`; TRUNCATE `ps_order_return_detail`; TRUNCATE `ps_order_return_state`; TRUNCATE `ps_order_return_state_lang`; TRUNCATE `ps_order_slip`; TRUNCATE `ps_order_slip_detail`; TRUNCATE `ps_message`; TRUNCATE `ps_cart`; TRUNCATE `ps_cart_product`; as mahmutta said, this will delete ALL ORDERS!!!this will NOT delete customers. but that can be done through the BO.Also, remeber that some modules use there own tables with order id relations, so be sure to check on those. 1 Link to comment Share on other sites More sharing options...
shaiss Posted August 7, 2009 Share Posted August 7, 2009 I put together a module just for this purposehttp://www.prestashop.com/forums/viewthread/24710/ Link to comment Share on other sites More sharing options...
MahmutGulerce Posted May 4, 2010 Share Posted May 4, 2010 OK1-) Open /prestashop site root/admin/tabs/AdminOrders.php via your fav editor.2-) Find this code about 25th line $this->colorOnBackground = true; 3-) After this add this line $this->delete = true; Thats allNow you can delete any of orders at back office regular i recomend add // comment start of the added line after delete 7 Link to comment Share on other sites More sharing options...
jarane Posted October 9, 2010 Share Posted October 9, 2010 For Presta 1.3.1 you have to use TRUNCATE `ps_orders`; TRUNCATE `ps_order_detail`; TRUNCATE `ps_order_discount`; TRUNCATE `ps_order_history`; TRUNCATE `ps_order_message`; TRUNCATE `ps_order_message_lang`; TRUNCATE `ps_order_return`; TRUNCATE `ps_order_return_detail`; TRUNCATE `ps_order_return_state`; TRUNCATE `ps_order_return_state_lang`; TRUNCATE `ps_order_slip`; TRUNCATE `ps_order_slip_detail`; TRUNCATE `ps_message`; TRUNCATE `ps_cart`; TRUNCATE `ps_cart_product`; Beacuse ps_order_customization_return doesn't exist. Link to comment Share on other sites More sharing options...
Popular Post pv Posted October 12, 2010 Popular Post Share Posted October 12, 2010 (edited) to delete one order at at time...Click on one of the orders ( in the back office) and replace the parameters “vieworder” with “deleteorder” from the urlFor examplehttp://yourdomain.com/admin/index.php?tab=AdminOrders&id_order=7&vieworder&token;=798dfd720021761c80d828eb3f2a8621Change it to:http://yourdomain.com/admin/index.php?tab=AdminOrders&id_order=7&deleteorder&token;=798dfd720021761c80d828eb3f2a8621Works like a charm! edit.... looks like ps forums is blocking html or something here now.. check out these free modules listed at http://www.prestashop.com/forums/topic/233442-free-modules-list-only-valuable-and-proven-solutions-21112013/ listed by vekia there are 2 solutions listed under Catalog, Orders, Products etc. management in BO Edited November 15, 2013 by pv (see edit history) 18 Link to comment Share on other sites More sharing options...
peanut Posted October 21, 2010 Share Posted October 21, 2010 to delete one order at at time...Click on one of the orders ( in the back office) and replace the parameters “vieworder” with “deleteorder” from the urlFor examplehttp://yourdomain.com/admin/index.php?tab=AdminOrders&id_order=7&vieworder;&token;=798dfd720021761c80d828eb3f2a8621Change it to:http://yourdomain.com/admin/index.php?tab=AdminOrders&id_order=7&deleteorder;&token;=798dfd720021761c80d828eb3f2a8621Works like a charm! Thank you soooo much..I was getting worried as I kept reading this thread but your simple trick made my life so easy!! Yay...thanks! :-) 6 Link to comment Share on other sites More sharing options...
Pippo3000 Posted October 21, 2010 Share Posted October 21, 2010 Works like a charm! affirmative, pv. that's been one of the best and easiest tricks I've ever seen so far. greatly appreciated. phil 1 Link to comment Share on other sites More sharing options...
Clothahump Posted October 25, 2010 Share Posted October 25, 2010 Maybe a simple Delete button would work well :roll: 1 Link to comment Share on other sites More sharing options...
krum Posted November 7, 2010 Share Posted November 7, 2010 I tried the tip to alter the vieworder url which seems to work great. My question is, with this tip is anyone concerned with the fact that it only seems to truncate that record from ps_orders and does not affect the corresponding related tables ala:`ps_order_detail`;`ps_order_history`;`ps_message`;`ps_cart`;`ps_cart_product`; Is it recommended to truncate these tables manually anyway when you delete an order or can you leave as is? Also, are there any issues with auto_ids to truncating these tables? Link to comment Share on other sites More sharing options...
nero_77 Posted December 6, 2010 Share Posted December 6, 2010 Great thread, very useful thanks Link to comment Share on other sites More sharing options...
sakrafanas Posted December 19, 2010 Share Posted December 19, 2010 OK1-) Open /prestashop site root/admin/tabs/AdminOrders.php via your fav editor.2-) Find this code about 25th line $this->colorOnBackground = true; 3-) After this add this line $this->delete = true; Thats allNow you can delete any of orders at back office regular i recomend add // comment start of the added line after delete Perfect! Thnx 3 Link to comment Share on other sites More sharing options...
the_farmer Posted March 29, 2011 Share Posted March 29, 2011 Thank you Mahmutta - worked perfectly Link to comment Share on other sites More sharing options...
dabyd Posted April 15, 2011 Share Posted April 15, 2011 OK1-) Open /prestashop site root/admin/tabs/AdminOrders.php via your fav editor.2-) Find this code about 25th line $this->colorOnBackground = true; 3-) After this add this line $this->delete = true; Thats allNow you can delete any of orders at back office regular i recomend add // comment start of the added line after delete WORKS!!!! thanks a lot Link to comment Share on other sites More sharing options...
Gipielle Posted June 20, 2011 Share Posted June 20, 2011 Thanks mahmutta !!! Link to comment Share on other sites More sharing options...
MahmutGulerce Posted June 20, 2011 Share Posted June 20, 2011 @Gipielle ,@dabyd, @the_farmer, @sakrafanas, @nero_77Thanks. I'm glad it had worked. I tried the tip to alter the vieworder url which seems to work great. My question is, with this tip is anyone concerned with the fact that it only seems to truncate that record from ps_orders and does not affect the corresponding related tables ala:`ps_order_detail`;`ps_order_history`;`ps_message`;`ps_cart`;`ps_cart_product`; Is it recommended to truncate these tables manually anyway when you delete an order or can you leave as is? Also, are there any issues with auto_ids to truncating these tables? It isnt necessary. The recomended solution is "edit admin-orders tab". Because delete function uses prestashop native class functions so it clears all related table rows in other tables as well.Other hand, i recomend the "truncate" query for use only once. It deletes all rows without any criterion. You cant use it again and again. For example all collected cart items will be deleted.Regards. 1 Link to comment Share on other sites More sharing options...
MNT Posted July 5, 2011 Share Posted July 5, 2011 Try this:http://www.nickbartlett.com/wordpress/how-to-delete-an-order-with-prestashop/ 3 Link to comment Share on other sites More sharing options...
viemonsta Posted December 6, 2011 Share Posted December 6, 2011 i think prestashop should add this feature for a next version 1 Link to comment Share on other sites More sharing options...
loop54 Posted February 15, 2012 Share Posted February 15, 2012 *push* Link to comment Share on other sites More sharing options...
gangsar.swapurba Posted March 12, 2012 Share Posted March 12, 2012 Perfect! Thnx yes thats worked like a charm Link to comment Share on other sites More sharing options...
Archangel Posted May 4, 2012 Share Posted May 4, 2012 It amazes me why such a simple feature takes so much discussion and still it's not implemented in the latest version. Are PRESTASHOP engineers listening to users AT ALL?? Link to comment Share on other sites More sharing options...
pantera Posted June 20, 2012 Share Posted June 20, 2012 OK 1-) Open /prestashop site root/admin/tabs/AdminOrders.php via your fav editor. 2-) Find this code about 25th line $this->colorOnBackground = true; 3-) After this add this line $this->delete = true; Thats all Now you can delete any of orders at back office regular i recomend add // comment start of the added line after delete I only did not understand when you say "i recomend add // comment start of the added line after delete ".What line have to be commented after delete? After the delete line there is a long line starting with $this->_select = '. Is that line that I should comment? See the line bellow: $this->_select = ' a.id_order AS id_pdf, CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) AS `customer`, osl.`name` AS `osname`, os.`color`, IF((SELECT COUNT(so.id_order) FROM `'._DB_PREFIX_.'orders` so WHERE so.id_customer = a.id_customer) > 1, 0, 1) as new, (SELECT COUNT(od.`id_order`) FROM `'._DB_PREFIX_.'order_detail` od WHERE od.`id_order` = a.`id_order` GROUP BY `id_order`) AS product_number'; Link to comment Share on other sites More sharing options...
MahmutGulerce Posted June 20, 2012 Share Posted June 20, 2012 I only did not understand when you say "i recomend add // comment start of the added line after delete ". What line have to be commented after delete? After the delete line there is a long line starting with $this->_select = '. Is that line that I should comment? See the line bellow: $this->_select = ' a.id_order AS id_pdf, CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) AS `customer`, osl.`name` AS `osname`, os.`color`, IF((SELECT COUNT(so.id_order) FROM `'._DB_PREFIX_.'orders` so WHERE so.id_customer = a.id_customer) > 1, 0, 1) as new, (SELECT COUNT(od.`id_order`) FROM `'._DB_PREFIX_.'order_detail` od WHERE od.`id_order` = a.`id_order` GROUP BY `id_order`) AS product_number'; I recomend // because it will be simple when you want to change back. It is not important. You also can delete whole line. Link to comment Share on other sites More sharing options...
pantera Posted June 20, 2012 Share Posted June 20, 2012 I recomend // because it will be simple when you want to change back. It is not important. You also can delete whole line. What do you mean with CHANGE BACK? If I comment the line, after deleting an order, is it possible to UNDO the delete?Is only the line bellow the delete line that should be commented? Thanks a lot! Link to comment Share on other sites More sharing options...
MahmutGulerce Posted June 20, 2012 Share Posted June 20, 2012 What do you mean with CHANGE BACK? If I comment the line, after deleting an order, is it possible to UNDO the delete? Is only the line bellow the delete line that should be commented? Thanks a lot! Pantera You can not UNDO after you delete an order. When you use // at the begining of a line, your PHP compiler will skip this line. Makes nothing about this line. Other hand as a typed on my first message: It is really serious risk to use delete function for orders. Because Order Class is an extend of ObjectModel Class. When you use delete function of ObjectModel, all rows about the order will be deleted at all tables which defined at Order class. So you can UNDO after delete. I simply described that: How you make orders deletable than how to turn of delete function. You can delete orders by adding this line $this->delete = true; After delete some orders you may want to turn of delete function due to delete orders by an oversight You can turn of deleting by adding // like //$this->delete = true Or remove $this->delete = true; Link to comment Share on other sites More sharing options...
pantera Posted June 20, 2012 Share Posted June 20, 2012 Pantera You can not UNDO after you delete an order. When you use // at the begining of a line, your PHP compiler will skip this line. Makes nothing about this line. Other hand as a typed on my first message: It is really serious risk to use delete function for orders. Because Order Class is an extend of ObjectModel Class. When you use delete function of ObjectModel, all rows about the order will be deleted at all tables which defined at Order class. So you can UNDO after delete. I simply described that: How you make orders deletable than how to turn of delete function. You can delete orders by adding this line $this->delete = true; After delete some orders you may want to turn of delete function due to delete orders by an oversight You can turn of deleting by adding // like //$this->delete = true Or remove $this->delete = true; Thanks for the answer. I'm observing that even after deleting an order, the DETAILS of that order are not deleted. They remain in the table PS_ORDER_DETAIL.After deleting an order using the bottom that is added after inserting the line of code that you suggest, seems that is still necessary to clean some tables. What do you think? Link to comment Share on other sites More sharing options...
MahmutGulerce Posted June 20, 2012 Share Posted June 20, 2012 Thanks for the answer. I'm observing that even after deleting an order, the DETAILS of that order are not deleted. They remain in the table PS_ORDER_DETAIL. After deleting an order using the bottom that is added after inserting the line of code that you suggest, seems that is still necessary to clean some tables. What do you think? I can describe that Order Class is an Extend of ObjectModel but all related tables not defined. Only orders table defined protected $tables = array ('orders'); So if you want to delete all related tables you can modify this line like (But I never recomend this) protected $tables = array ('order_credit_data', 'order_detail', 'order_discount', 'order_history', 'order_message', 'order_message_lang', 'order_return', 'order_return_detail', 'order_return_state', 'order_return_state_lang', 'order_slip', 'order_slip_detail', 'order_state', 'order_state_lang'); Link to comment Share on other sites More sharing options...
pepfoto Posted October 31, 2012 Share Posted October 31, 2012 You need to get this folks who ask for a DELETE button. If they create one, the shop software will be illegal in the entire EU as a base for your business. It is illegal to be able to remove payment or ordering information and/or invoice information from a business. Link to comment Share on other sites More sharing options...
ligurstone Posted November 22, 2012 Share Posted November 22, 2012 in prestashop 1.5 prestashop site there is no root / admin / tabs / AdminOrders.php, how can we do? thanks Link to comment Share on other sites More sharing options...
vekia Posted November 22, 2012 Share Posted November 22, 2012 in prestashop 1.5 prestashop site there is no root / admin / tabs / AdminOrders.php, how can we do? thanks You can find on this forum a lot of modules for deleting orders. Here is a link for free module: delete orders in prestashop 2 Link to comment Share on other sites More sharing options...
wagac2012 Posted November 25, 2012 Share Posted November 25, 2012 hey! for PS 1.5 I have found this FREE module here, I try and works. Took me 5 (real) minutes to install and delete all test orders you will have a delete button at the end of the order line in the BO and can do test orders between real orders and then delete Cool, Free!!! http://catalogo-onlinersi.net/en/back-office-prestashop-modules/160-delete-orders-prestashop-module.html Link to comment Share on other sites More sharing options...
christianmj Posted January 28, 2013 Share Posted January 28, 2013 hey there while the previous comments may work in older versions of prestashop (i have not tested them) they do not work for prestashop 1.5* in order to get the delete order icon in version 1.5* you need to add the following to FILE: WEB_ROOT/controllers/admin/AdminOrdersController.php public function __construct() { $this->table = 'order'; $this->className = 'Order'; $this->lang = false; $this->addRowAction('view'); [color=#0000ff]$this->addRowAction('delete');[/color] $this->explicitSelect = true; NOTE the $this->addRowAction('delete'); is added to the constructor the allowed action (as fare as i now) 'view', 'edit', 'delete', 'duplicate' Regards And happy coding 6 Link to comment Share on other sites More sharing options...
FancifulFlights Posted April 14, 2013 Share Posted April 14, 2013 Thank you soooo much..I was getting worried as I kept reading this thread but your simple trick made my life so easy!! Yay...thanks! :-) That is pure genius! I can't even imagine why or how it works but this is BY FAR the easiest solution! Thanks! Link to comment Share on other sites More sharing options...
Totti Posted April 15, 2013 Share Posted April 15, 2013 In PS 1.5.4 i use module pscleaner. Link to comment Share on other sites More sharing options...
nandelbosc Posted April 15, 2013 Share Posted April 15, 2013 In PS 1.5.4 i use module pscleaner. Where can we find this module? Link to comment Share on other sites More sharing options...
Totti Posted April 15, 2013 Share Posted April 15, 2013 Is present in the modules tab. Link to comment Share on other sites More sharing options...
nandelbosc Posted April 15, 2013 Share Posted April 15, 2013 Is present in the modules tab. Thanks, but... By default? I can't find it on my fresh prestashop installation. Any clue to find it? Link to comment Share on other sites More sharing options...
Totti Posted April 15, 2013 Share Posted April 15, 2013 Here the module. Link to comment Share on other sites More sharing options...
nandelbosc Posted April 15, 2013 Share Posted April 15, 2013 Ok, I found it on my prestashop 1.5.4.0 but no on other 1.5.3.1 Thank's Totti! Link to comment Share on other sites More sharing options...
nandelbosc Posted April 15, 2013 Share Posted April 15, 2013 http://installatron.com/updatefeed/prestashop_1_5_4_0 Link to comment Share on other sites More sharing options...
jd.creative Posted May 17, 2013 Share Posted May 17, 2013 (edited) It amazes me why such a simple feature takes so much discussion and still it's not implemented in the latest version. Are PRESTASHOP engineers listening to users AT ALL?? Sorry to get involved so late, but it's doing my head in. I'm half way through page 2 and I've already seen multiple people demand that Prestashop add this feature in. Pepfoto gave a very clear explanation as to why they cannot do this: You need to get this folks who ask for a DELETE button. If they create one, the shop software will be illegal in the entire EU as a base for your business. It is illegal to be able to remove payment or ordering information and/or invoice information from a business. As a business you should not be deleting records of any orders or invoices, this is how fraud starts... of course I'm aware you could be keeping the information in other places, but it would be illegal to offer you the ability to delete this information. Having said that, I'm aware that most of you are only trying to delete the sample data and not your own sales data. SO HERES A DEAD EASY SOLUTION For that, I have been using this solution: http://hassadee.com/...prestashop-1-5/ It allows you to just add one line of code to the core code, that then provides a delete button next to the orders. You can then delete the orders by pressing that button, then go back in to the core code and remove that one line you just added, easier and safer that editing the database directly. JD Edited May 17, 2013 by jd.creative (see edit history) 2 Link to comment Share on other sites More sharing options...
starcenter Posted June 23, 2013 Share Posted June 23, 2013 (edited) ... YES! I followed jd.creative's steps and 'voila'... it worked!!! I'm using ver. 1.5.4.1 Edited June 23, 2013 by starcenter (see edit history) Link to comment Share on other sites More sharing options...
Bejo Posted June 23, 2013 Share Posted June 23, 2013 Here the module. thx you so much for sharing. 1 Link to comment Share on other sites More sharing options...
somesy Posted June 28, 2013 Share Posted June 28, 2013 @PV - Thanks, so simple but works perfectly, great for getting rid of all those test orders 1 Link to comment Share on other sites More sharing options...
job8 Posted July 16, 2013 Share Posted July 16, 2013 to delete one order at at time... Click on one of the orders ( in the back office) and replace the parameters “vieworder” with “deleteorder” from the url For example http://yourdomain.co...0d828eb3f2a8621 Change it to: http://yourdomain.co...0d828eb3f2a8621 Works like a charm! it works on 1.5.4.1 tanx 2 Link to comment Share on other sites More sharing options...
mirustics Posted August 7, 2013 Share Posted August 7, 2013 (edited) to delete one order at at time... Click on one of the orders ( in the back office) and replace the parameters “vieworder” with “deleteorder” from the url For example http://yourdomain.co...0d828eb3f2a8621 Change it to: http://yourdomain.co...0d828eb3f2a8621 Works like a charm! Quick and easy fix. Thank you!! I have been trying to get rid of the sample order that was installed with prestashop for a month. Edited August 7, 2013 by mirustics (see edit history) Link to comment Share on other sites More sharing options...
benjamin utterback Posted August 7, 2013 Share Posted August 7, 2013 That is a good fix but you can also choose not to have the sample data at installation... Also, you can use the pscleaner module to clear out the sample data. It ships with every copy of 1.5.4.1 Link to comment Share on other sites More sharing options...
vekia Posted August 7, 2013 Share Posted August 7, 2013 that's right, in my opinion pscleaner is the best method in this case. If you will use this addon, you don't have to worry - it's totally safe to database - and this is the most important thing ! 1 Link to comment Share on other sites More sharing options...
V-5 Posted August 8, 2013 Share Posted August 8, 2013 hey there while the previous comments may work in older versions of prestashop (i have not tested them) they do not work for prestashop 1.5* in order to get the delete order icon in version 1.5* you need to add the following to FILE: WEB_ROOT/controllers/admin/AdminOrdersController.php public function __construct() { $this->table = 'order'; $this->className = 'Order'; $this->lang = false; $this->addRowAction('view'); [color=#0000ff]$this->addRowAction('delete');[/color] $this->explicitSelect = true; NOTE the $this->addRowAction('delete'); is added to the constructor the allowed action (as fare as i now) 'view', 'edit', 'delete', 'duplicate' Regards And happy coding This is just awesome and the simplest fix... Excellent... thanks for sharing.... Now I can delete individual orders too.... Deleting orders could not get any more easier than this.... 1 Link to comment Share on other sites More sharing options...
sYs^ Posted August 22, 2013 Share Posted August 22, 2013 You can also add $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Would you like to delete the selected items?'))); So you can delete multiple orders. Link to comment Share on other sites More sharing options...
networkerbr Posted September 4, 2013 Share Posted September 4, 2013 Very easy with this: http://mypresta.eu/modules/administration-tools/delete-orders-free.html Link to comment Share on other sites More sharing options...
RLMemorabilia Posted September 17, 2013 Share Posted September 17, 2013 This is very helpful ... and simple !!! Link to comment Share on other sites More sharing options...
Javi Ferrer Posted September 17, 2013 Share Posted September 17, 2013 (edited) It's possible that whit this large thread this is a stupid comment, but in my module dashboard on version 1.5.4.1 I have a module called "Prestashop Cleaner" developed by Prestashop, that do this work on the fly... With this module you can: - Delete all catalog data, without possible rollback: products, features, categories, tags, images, prices, attachments, scenes, stocks, attribute groups and values, manufacturers, suppliers... - Delete all data of the orders and customers without possible rollback: customers, carts, orders, connections, guests, messages, stats... The module advert that You can not roolback. Use with care. Edited September 17, 2013 by Valentin Yonte (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted September 17, 2013 Share Posted September 17, 2013 but for example, when you have got working store, with many orders and you want to test order form - you cannot use "store cleaner" mainly because it removes all orders 1 Link to comment Share on other sites More sharing options...
Javi Ferrer Posted September 17, 2013 Share Posted September 17, 2013 Prestashop Legend, You have right. So This module must to be used to clean the demo data just after new install, and never in a live store. Thanks for add this Warning. 1 Link to comment Share on other sites More sharing options...
jimmyc Posted November 15, 2013 Share Posted November 15, 2013 (edited) vekia is tne man (i was pv) now jc due to forgetting my user name... or login or something. check out the prestshop free modules in the forum he has compiled and tested. There is a great mod there for deleting orders now by vekia! http://www.prestashop.com/forums/topic/191037-free-delete-orders-module/ http://www.prestashop.com/forums/topic/233442-free-modules-list-only-valuable-and-proven-solutions-21112013/ highly recommended! Edited November 15, 2013 by jimmyc (see edit history) Link to comment Share on other sites More sharing options...
Attila Bogozi Posted December 9, 2013 Share Posted December 9, 2013 Very cool. Thank You. Link to comment Share on other sites More sharing options...
fineform Posted January 7, 2014 Share Posted January 7, 2014 affirmative, pv. that's been one of the best and easiest tricks I've ever seen so far. greatly appreciated. phil Nice little trick, for sure. Still have to fix your quantities though - it doesn't seem to undo the inventory decrement... (Not difficult to do manually though) Like it! Link to comment Share on other sites More sharing options...
vekia Posted January 7, 2014 Share Posted January 7, 2014 hello you mean that you want to recover quantities? thats right? im asking because im author of this addon and i think that i can try to update it Link to comment Share on other sites More sharing options...
omaral Posted January 25, 2014 Share Posted January 25, 2014 Sorry to get involved so late, but it's doing my head in. I'm half way through page 2 and I've already seen multiple people demand that Prestashop add this feature in. Pepfoto gave a very clear explanation as to why they cannot do this: As a business you should not be deleting records of any orders or invoices, this is how fraud starts... of course I'm aware you could be keeping the information in other places, but it would be illegal to offer you the ability to delete this information. Having said that, I'm aware that most of you are only trying to delete the sample data and not your own sales data. SO HERES A DEAD EASY SOLUTION For that, I have been using this solution: http://hassadee.com/...prestashop-1-5/ It allows you to just add one line of code to the core code, that then provides a delete button next to the orders. You can then delete the orders by pressing that button, then go back in to the core code and remove that one line you just added, easier and safer that editing the database directly. JD I wouldn't use this solution. It made many problems to me. This solution delete the order only from `ps_orders` table but the order information stays in many other tables. Example: I deleted order number: 4 - with 3 products Then I placed new order with 3 products and presta gave it id ...: 4 When I looked in orders tab the new order had 6 products instead of 3. That was because information from old number 4 order wasn't deleted when I deleted order with described method. So I don't recommend this solution. I'm using this module after a few modifications. Link to comment Share on other sites More sharing options...
El Patron Posted January 25, 2014 Share Posted January 25, 2014 It is NOT recommended (by me) to delete test orders. simply edit each test order, cancel order. There are so many issues created by deleting test orders..so just don't do it. el Link to comment Share on other sites More sharing options...
slappedsilly Posted January 30, 2014 Share Posted January 30, 2014 I deleted order number: 4 - with 3 products Then I placed new order with 3 products and presta gave it id ...: 4 When I looked in orders tab the new order had 6 products instead of 3. That was because information from old number 4 order wasn't deleted when I deleted order with described method. So I don't recommend this solution. I'm using this module after a few modifications. This is a surprising issue. In my 25 years of dev work I have never allowed a customer/product/order entry to *reuse* indexes. This is (was?) rule 101 of database development. We always kept latest indexes in a seperate DB and incremented by 1 on a new record. Very odd that it is allowed. For mine, I am setting up a brand new instance of PS now and I have lots of orders being created with payment integration being tested. Do I now need to go through every order and cancel implicitly because I can't batch delete? Notwithstanding I will have legacy test orders sitting for the lifespan of this package? Comments regarding it's not allowed due to legality mentioned way back are somewhat moot. 1) It can't be illegal nor wrong to remove *test* data as no corresponding - auditable - transaction process is linked and 2) any sql jockey with an IQ greater than 10 can edit the database anyway. I see there is a module for "free" with embedded ads to purchase a "better version" which also makes this "potential for fraud" moot anyway. Which is what this whole thread was about really... Deleting TEST data. Seems a very simple and common problem requiring a rather complex and ambiguous solution tbh. If it needs a hack or a module for a relatively simple feature, it's bad imho. Now excuse me, I'm off to write and test sql scripts to kill the DB test data prior to going live.... Sad... Link to comment Share on other sites More sharing options...
vekia Posted January 30, 2014 Share Posted January 30, 2014 prestashop has got module named pscleaner this simple addon removes all "test" data (remove orders and reset auto_increment values), so you can run with vanilla shop then. it's a module installed with ps by default, no hidden fees, no payment etc. 1 Link to comment Share on other sites More sharing options...
slappedsilly Posted January 31, 2014 Share Posted January 31, 2014 Thank you vekia. I went through the thread more in detail and saw this had been mentioned already so my bad for being so impetuous Link to comment Share on other sites More sharing options...
vekia Posted January 31, 2014 Share Posted January 31, 2014 but in fact, you've got right, it's more than necessary to have got possibility to remove test orders pscleaner is good enough module, but only when you want to TRUNCATE tables, not to remove certain orders 1 Link to comment Share on other sites More sharing options...
Martinp Posted April 22, 2014 Share Posted April 22, 2014 Why aren't in Prestahop delete orders? Thanks you for reply. Martin Link to comment Share on other sites More sharing options...
vekia Posted April 22, 2014 Share Posted April 22, 2014 due to the consistency of the database, prestashop has got different feature: disabling voucher. but in fact, tehre is module to clean database named PS CLEANER, but it's useful only when you want to remove test orders in bulk (all of them) Link to comment Share on other sites More sharing options...
Kingstar Posted May 29, 2014 Share Posted May 29, 2014 to delete one order at at time... Click on one of the orders ( in the back office) and replace the parameters “vieworder” with “deleteorder” from the url For example http://yourdomain.com/admin/index.php?tab=AdminOrders&id_order=7&vieworder&token;=798dfd720021761c80d828eb3f2a8621 Change it to: http://yourdomain.com/admin/index.php?tab=AdminOrders&id_order=7&deleteorder&token;=798dfd720021761c80d828eb3f2a8621 Works like a charm! edit.... looks like ps forums is blocking html or something here now.. check out these free modules listed at http://www.prestashop.com/forums/topic/233442-free-modules-list-only-valuable-and-proven-solutions-21112013/ listed by vekia there are 2 solutions listed under Catalog, Orders, Products etc. management in BO Thanks, PV! You're the man! The damn test orders were messing up my dashboard's stats and accounting. 2 Link to comment Share on other sites More sharing options...
franzneves Posted June 1, 2014 Share Posted June 1, 2014 Perfect!!!! Thanks Link to comment Share on other sites More sharing options...
PrestaToys Posted June 12, 2014 Share Posted June 12, 2014 Holy Confusion Batman!!! 1) click an order in B/O and change URL from "vieworder" to "deleteorder" or 2) some coding changes to order.php or 3) buy a module to delete orders or 4) do nothing! just cancel them and "fuggetaboutit"! What to do, what to do? a) I only want to delete test orders and I do not want to mess up my database. I have admin staff processing orders, so i don't want a "delete" function available to them, or things could get really messed up. What to do? What to do? 1 Link to comment Share on other sites More sharing options...
nortonlgn Posted July 19, 2014 Share Posted July 19, 2014 Most people using Prestashop are from Europe, which have annoying nanny state policies. One of these, is that you are not allowed to have software that allows you to delete orders (like if that is really going to slow down real criminals). I am from Canada, and here we can delete orders until the cows come home without fear of prosecution (if we are deleting them legitimately) [well maybe not in Quebec]. I guess we need two versions of Prestashop. Prestashop-NS (Nanny State) and Prestashop-FW (Free World) 2 Link to comment Share on other sites More sharing options...
PrestaToys Posted July 21, 2014 Share Posted July 21, 2014 Most people using Prestashop are from Europe, which have annoying nanny state policies. One of these, is that you are not allowed to have software that allows you to delete orders (like if that is really going to slow down real criminals). I am from Canada, and here we can delete orders until the cows come home without fear of prosecution (if we are deleting them legitimately) [well maybe not in Quebec]. I guess we need two versions of Prestashop. Prestashop-NS (Nanny State) and Prestashop-FW (Free World) Made my Monday... laughed my head off! I am from Canada as well, so I even understood the Quebec joke. Hope no one was offended, and understood the humour with which (I believe) it was intended! => 2 Versions would be best, or one version, that adapts to the country it is installed in. => the way shipping levels are calculated, based on prices INCLUDING TAX is also a big problem! Here, it's "before tax". Anyway, on a fresh install, I see that Prestashop now has a MODULE called Prestashop Cleaner to get rid of the sample data. A nice touch! I used it. It works well, but left a few remnants of the sample data, which I deleted manually on my admin. But thankfully it did delete the sampler orders!!! Link to comment Share on other sites More sharing options...
Rineez Posted September 23, 2014 Share Posted September 23, 2014 I think vieworder to delete order works best. The "Delete orders" module available for doing this doesn't work well. It was deleting order return statuses(I don't see the reason to do this), and it is not deleting entries from order_invoices table(which infact are related to order entities and should be deleted in my opinion, because they can cause problems in the application later). As ussual, we also had lot of test orders in our site to delete. So I wrote a simple javascript snippet to delete all orders automatically using "vieworder-deleteorder" URL conversion technique. I'm sharing the script here: Please backup your database before trying to delete orders in any way. There is no standard way and none of these are guaranteed to be error free. PS: I have written this for Prestashop 1.5.6.1 and it is not tested in any other versions. Login to Back office and open Orders option from Orders menu to see list of orders. Execute the following javascript code in that page to delete all orders displayed in current page. I used firebug console to do this on our site, which is the quickest way I know. The script will start deleting orders one by one in background until everything on current page is deleted. Leave the script there for sometime and allow it to finish. Of course, you can see progress of the process also inside the firebug console. var AllLinks = []; $('table.table_grid tbody .table.order tbody tr').each(function(){ var click = $(this).find('td:eq(1)').attr('onclick'); var parts = click.split(' = '); var link = parts[1]; link = link.replace(/'/g,""); link = link.replace(/vieworder/,"deleteorder"); AllLinks.push(link); }); console.log(AllLinks); function ajax_delete1(){ url = AllLinks.pop(); if(url){ $.get(url,function(){ ajax_delete1(); }); } } ajax_delete1(); Link to comment Share on other sites More sharing options...
Ed_03 Posted May 7, 2015 Share Posted May 7, 2015 Thanx pv the simple trick worked like a charm indeed. Link to comment Share on other sites More sharing options...
OryginalDekeR Posted May 11, 2015 Share Posted May 11, 2015 to delete one order at at time... Click on one of the orders ( in the back office) and replace the parameters “vieworder” with “deleteorder” from the url NICE TRICK! 2 Link to comment Share on other sites More sharing options...
outlet.ee Posted July 1, 2015 Share Posted July 1, 2015 In 1.6 add $this->addRowAction('delete'); to controllers/Admin/AdminOrderControllers to line 51 (near the other 'addRowAction') for deleting single order. for bulk deletion change controllers/Admin/AdminOrderControllers line 190 'updateOrderStatus' => array('text' => $this->l('Change Order Status'), 'icon' => 'icon-refresh') to 'updateOrderStatus' => array('text' => $this->l('Change Order Status'), 'icon' => 'icon-refresh'), 'delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'),'icon' => 'icon-trash') 4 Link to comment Share on other sites More sharing options...
rv0206 Posted July 3, 2015 Share Posted July 3, 2015 I do want to say it again and wont get tired thank you so much for this software/product it is the best i have come across after several years of working with it has come a long way but anyways get to the point here, only leaving a comment to say thank you to PV after looking for several hours i found this and just like that worked great thank you friend was really easy. And also want to say i could not agree with DEBUGGINGLIFE any more it is very true and not this forum but many out there people just comment about 100 things except the one thing we all are here asking for, if you don't the answer to the question then keep your comments to your self, yes we can all give our input on something but don't waste others time with silly stuff, anyways thanks again to each and everyone out there that supports this. Link to comment Share on other sites More sharing options...
bcsteeve Posted July 17, 2015 Share Posted July 17, 2015 I keep seeing advice to "cancel" an order... I SEE NO OPTION WHATSOEVER TO CANCEL AN ORDER. Link to comment Share on other sites More sharing options...
pbeverley82 Posted July 18, 2015 Share Posted July 18, 2015 to delete one order at at time... Click on one of the orders ( in the back office) and replace the parameters “vieworder” with “deleteorder” from the url For example http://yourdomain.com/admin/index.php?tab=AdminOrders&id_order=7&vieworder&token;=798dfd720021761c80d828eb3f2a8621 Change it to: http://yourdomain.com/admin/index.php?tab=AdminOrders&id_order=7&deleteorder&token;=798dfd720021761c80d828eb3f2a8621 Works like a charm! edit.... looks like ps forums is blocking html or something here now.. check out these free modules listed at http://www.prestashop.com/forums/topic/233442-free-modules-list-only-valuable-and-proven-solutions-21112013/ listed by vekia there are 2 solutions listed under Catalog, Orders, Products etc. management in BO You, Sir, are a genius. Works like a charm. Thank you. 1 Link to comment Share on other sites More sharing options...
bcsteeve Posted July 18, 2015 Share Posted July 18, 2015 Yeah, a charm until you find out down the road that it was done incorrectly. only the orders table is affected, but there are a whole slew of related tables that should be modified as well. One of the many reasons I today decided to abandon my work with PS for now. I either have to commit to fixing PS by doing what they won't (support, sensible functionality) which I have no time for right now, or else move on to some real software. Link to comment Share on other sites More sharing options...
Zengorius Posted September 11, 2015 Share Posted September 11, 2015 Hi everyone, best solution is instant delete rows in database. (Prestashop version 1.6.x) 1. For every order set state "canceled". For return goods to stock. 2. In database delete those 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 3. Last step is set "1" value for auto_increment for tables above that has set option auto_increment of course. That is it Link to comment Share on other sites More sharing options...
Eric2015 Posted November 23, 2015 Share Posted November 23, 2015 to delete one order at at time... Click on one of the orders ( in the back office) and replace the parameters “vieworder” with “deleteorder” from the url For example http://yourdomain.com/admin/index.php?tab=AdminOrders&id_order=7&vieworder&token;=798dfd720021761c80d828eb3f2a8621 Change it to: http://yourdomain.com/admin/index.php?tab=AdminOrders&id_order=7&deleteorder&token;=798dfd720021761c80d828eb3f2a8621 Works like a charm! Thanks, really like a charm edit.... looks like ps forums is blocking html or something here now.. check out these free modules listed at http://www.prestashop.com/forums/topic/233442-free-modules-list-only-valuable-and-proven-solutions-21112013/ listed by vekia there are 2 solutions listed under Catalog, Orders, Products etc. management in BO Link to comment Share on other sites More sharing options...
gabdara Posted January 16, 2016 Share Posted January 16, 2016 Here's a method to definitely delete test orders that keeps your database clean afterwords. It's using MySQL to make sure orders are removed from all the related tables. Also if you created customers accounts for test you could delete all the orders placed with them. MySQL method to delete test orders. Link to comment Share on other sites More sharing options...
bcsteeve Posted January 16, 2016 Share Posted January 16, 2016 Hey, that's great! And it only took 7 years and 2 months to solve this issue. I'm not detracting from your efforts. I'm pointing out [one of] the reasons people should run for the hills when considering this web application for use with their business, where they may need faster response times than the average life of a [spam-filter]. 1 Link to comment Share on other sites More sharing options...
than Posted February 9, 2016 Share Posted February 9, 2016 PrestaShop™ 1.5.6.2 controllers\admin\AdminOrdersController.php Add to under : $this->addRowAction('view'); $this->addRowAction('delete'); $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); Link to comment Share on other sites More sharing options...
ElienPhilips Posted February 9, 2016 Share Posted February 9, 2016 Hi, in the cloud version, just cancel all your test orders in the change status of order menu, this will make them go away in all the totals in your dashboard! hope this helps you! Link to comment Share on other sites More sharing options...
rivaj.pk Posted March 28, 2016 Share Posted March 28, 2016 Its very easy method for it hopefully its help. Link to comment Share on other sites More sharing options...
nikmagnus Posted May 2, 2016 Share Posted May 2, 2016 This worked well for me in PS 1.6.1.4. Thanks for making these instructions clear and simple. Nik PrestaShop™ 1.5.6.2 controllers\admin\AdminOrdersController.php Add to under : $this->addRowAction('view'); $this->addRowAction('delete'); $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); Link to comment Share on other sites More sharing options...
gabdara Posted May 3, 2016 Share Posted May 3, 2016 The method with $this->addRowAction('delete'); might seem to work at first glance because it lets you delete records from ps_orders table, but it actually lets you with a lot of junk data in other tables that refer to the order id. Link to comment Share on other sites More sharing options...
ssvapes Posted May 22, 2016 Share Posted May 22, 2016 to delete one order at at time... Click on one of the orders ( in the back office) and replace the parameters “vieworder” with “deleteorder” from the url For example http://yourdomain.com/admin/index.php?tab=AdminOrders&id_order=7&vieworder&token;=798dfd720021761c80d828eb3f2a8621 Change it to: http://yourdomain.com/admin/index.php?tab=AdminOrders&id_order=7&deleteorder&token;=798dfd720021761c80d828eb3f2a8621 Works like a charm! edit.... looks like ps forums is blocking html or something here now.. check out these free modules listed at http://www.prestashop.com/forums/topic/233442-free-modules-list-only-valuable-and-proven-solutions-21112013/ listed by vekia there are 2 solutions listed under Catalog, Orders, Products etc. management in BO Excellent suggestion that still works in 2016 Who knows how to add this to the back office? Perhaps make it a drop down or check box? Link to comment Share on other sites More sharing options...
gentritg Posted August 11, 2016 Share Posted August 11, 2016 Its very easy method for it hopefully its help. But what If you want to delete just the orders? and not the Customers.. ? Bad Module for that Link to comment Share on other sites More sharing options...
Recommended Posts