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
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
Hi debugginglife!
We already replied thousand of time to that question.
Please do a search inside the forum.
We already replied thousand of time to that question.
Please do a search inside the forum.
Matthieu Biart • Core developer | Développeur coeur • PrestaShop
Help PrestaShop, make a donation! • Aidez la communauté, soumettez vos rapports de bug uniquement en anglais
Help PrestaShop, make a donation! • Aidez la communauté, soumettez vos rapports de bug uniquement en anglais
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)
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)
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.
But when You still want delete orders - then You can do that at database. Look tables orders and order* tables.
The Box said Windows XP or better!
So I installed Linux
PrestaPortal- Presta themes, modules, tricks etc
So I installed Linux
PrestaPortal- Presta themes, modules, tricks etc
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 ;)
From 1227297010:
Hi debugginglife!
We already replied thousand of time to that question.
Please do a search inside the forum.
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! :)
Regards
Kyrre
Kyrre
u can use this sql querry but before that you must create a backup
warning this deletes all orders and dont expand which is real order which is for test.
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.
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
I'm still testing this, but I'd also add the below to the query above
And remember if you get a mysql error, check your table prefix!
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!
Sorry for a duplicate post, but heres the SQL query that does work, tested 10 times over
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.
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.
OK
1-) Open /prestashop site root/admin/tabs/AdminOrders.php via your fav editor.
2-) Find this code about 25th line
3-) After this add this line
Thats all
Now you can delete any of orders at back office regular ;)
i recomend add // comment start of the added line after delete
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
For Presta 1.3.1 you have to use
Beacuse ps_order_customization_return doesn't exist.
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.
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!
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!
From 1286892210:
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!
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! :-)
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
PS v1.3.2.x
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?
`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?




Back to top










