Please note that PrestaShop Community sections are largely self-moderated. PrestaShop team members may or may not participate in non-English sections. To improve the chances of receiving feedback to your question or comment, please post it in English to the main sections of our Forum.

Vous parlez français ? par ici !
[Solved] Deleting test orders
#1
Posted 16 November 2008 - 01:39 PM
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
#2
Posted 21 November 2008 - 08:23 PM
#3
Posted 21 November 2008 - 08:50 PM
We already replied thousand of time to that question.
Please do a search inside the forum.
Help PrestaShop, make a donation! • Aidez la communauté, soumettez vos rapports de bug uniquement en anglais
#4
Posted 21 November 2008 - 09:47 PM
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)
#5
Posted 23 November 2008 - 09:18 AM
But when You still want delete orders - then You can do that at database. Look tables orders and order* tables.
So I installed Linux
PrestaPortal- Presta themes, modules, tricks etc
#6
Posted 25 November 2008 - 02:02 PM
#7
Posted 26 November 2008 - 12:22 PM
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 ;)
#8
Posted 30 January 2009 - 11:41 AM
From 1227297010:
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! :)
Kyrre
#9
Posted 23 May 2009 - 05:27 PM
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.
#10
Posted 05 August 2009 - 09:01 PM
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!
#11
Posted 05 August 2009 - 10:13 PM
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.
#12
Posted 07 August 2009 - 06:48 PM
#13
Posted 04 May 2010 - 07:22 AM
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
#14
Posted 09 October 2010 - 07:10 PM
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.
#15
Posted 12 October 2010 - 03:03 PM
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!
#16
Posted 21 October 2010 - 12:12 PM
From 1286892210:
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!
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! :-)
#17
Posted 21 October 2010 - 01:02 PM
From 1286892210:
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
#18
Posted 25 October 2010 - 06:37 AM
#19
Posted 07 November 2010 - 05:09 PM
`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?
#20
Posted 06 December 2010 - 04:01 PM
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users













