Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 30
How to delete orders complete? 
 
kathy
Member
 
Avatar
Total Posts:  44
Joined:  2007-11-11
 

Hello again,

I tried to delete orders in the backend but i can only set the status to “cancelled” and the order is still there.
How can I delete the order complete from the backend so that it isn’t shown anymore?

Thanks,
kathy

 
Magento Community Magento Community
Magento Community
Magento Community
 
JBerry
Jr. Member
 
Total Posts:  4
Joined:  2007-12-27
NC, USA
 

I have the same question… any suggestions?

 
Magento Community Magento Community
Magento Community
Magento Community
 
macsmart
Jr. Member
 
Total Posts:  29
Joined:  2007-08-31
Greensboro, NC
 

Me too, same question…

Anyone?

 
Magento Community Magento Community
Magento Community
Magento Community
 
macsmart
Jr. Member
 
Total Posts:  29
Joined:  2007-08-31
Greensboro, NC
 

Nobody?

I would assume there will have to be a SQL query solution (as opposed to anything in admin), but I haven’t familiarized myself with the database structure enough to feel comfortable poking around and dropping records on my own.. red face

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

If your database was correctly setup with InnoDB, to delete an order using public order ID:

select @order_id:=entity_id from sales_order_entity where increment_id='100000001';
delete from sales_order_entity where entity_id=@order_id or parent_id=@order_id;
 
Magento Community Magento Community
Magento Community
Magento Community
 
Lior
Magento Team
 
Avatar
Total Posts:  293
Joined:  2007-09-24
 

There is not option in the admin to delete orders at the moment.
It is possible that it will be in some future release or contributed by the community.

 
Magento Community Magento Community
Magento Community
Magento Community
 
macsmart
Jr. Member
 
Total Posts:  29
Joined:  2007-08-31
Greensboro, NC
 

Perfect!! Thank you Moshe!

 
Magento Community Magento Community
Magento Community
Magento Community
 
gamebate
Jr. Member
 
Total Posts:  1
Joined:  2008-01-15
 

select @order_id:=entity_id from sales_order_entity where increment_id=’100000001’;
delete from sales_order_entity where entity_id=@order_id or parent_id=@order_id;

How do i make the above code work for me? I want to delete previous orders from my Orders Category. Where do i type this code? Where do i upload it? I need the instrctions please! :(

Thanks for the quick response.

 
Magento Community Magento Community
Magento Community
Magento Community
 
macsmart
Jr. Member
 
Total Posts:  29
Joined:  2007-08-31
Greensboro, NC
 

You’ll need to apply this SQL Query/command directly to your magento database. I used phpMyAdmin for this, which is provided with most hosting plans.


Disclaimer: Please be sure you know what you’re doing before running raw SQL commands, and back up your database first, just in case something goes wrong in the process.

Good luck!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Erik Benjamin
Jr. Member
 
Total Posts:  7
Joined:  2008-03-21
The Netherlands
 

Hello,

Is there already a good way available to remove test orders? We want to go live with the shop but we cannot do that because of all the test orders. Using the SQL code above was not succesfull.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jonahcoyote
Jr. Member
 
Total Posts:  12
Joined:  2008-02-16
Madison, WI
 

The above query by Moshe works fine for me but I found it doesn’t remove entires from the Sales>Orders page. To do this all I did was delete each entry in the sales_order table and it worked - no more test orders anywhere!

It’s always a good idea to run a quick simple phpMyAdmin export to backup your entire database before messing around in there… In phpMyAdmin make sure you are in the root, if you are not click on your db name at the top on the left hand side. You should see all the db tables appear in the window. Now click on the Export tab. Here just make sure all your tables are selected, leave everything else at default (unless you know what you’re doing), and check “Save as file” at the bottom. You can also select whether or not you want any compression and the name template. Then just click Go in the right bottom corner and a save dialog should appear letting you save the db backup to your computer somewhere. If anything ever goes wrong doing these db edits you’ve got a full backup! Restoring is even easier! Just go to the Import tab, select your file you just saved, leave everything else at default and click Go! Poof!!!! Restored to all its former glory. Yay!

- Jonah

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Moderator
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

Perfect, thanks guys! smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
mdumka
Member
 
Avatar
Total Posts:  56
Joined:  2008-02-28
 

I still have some best sellers showing up ... how do I clean those up?

I cant believe there is no way to delete orders ... we need this ASAP ...

Mike

 
Magento Community Magento Community
Magento Community
Magento Community
 
rvelton
Sr. Member
 
Total Posts:  82
Joined:  2007-09-07
 

Yeah, that query is not cleaning up all the records of the orders that I am trying to delete.

Anyone have an updated query to run to completely delete orders?

Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dustin
Sr. Member
 
Total Posts:  160
Joined:  2008-03-13
Columbus, OH
 
rvelton - 08 May 2008 08:29 AM

Yeah, that query is not cleaning up all the records of the orders that I am trying to delete.

Anyone have an updated query to run to completely delete orders?

Thanks.

In phpmyadmin I just go into the “sales_order” table and just delete the order from there and it works for me.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dustin
Sr. Member
 
Total Posts:  160
Joined:  2008-03-13
Columbus, OH
 
Dustin - 13 May 2008 11:24 AM

rvelton - 08 May 2008 08:29 AM
Yeah, that query is not cleaning up all the records of the orders that I am trying to delete.

Anyone have an updated query to run to completely delete orders?

Thanks.

In phpmyadmin I just go into the “sales_order” table and just delete the order from there and it works for me.

After looking at it more this does not delete the order completely from the system.

Where in the database does it save the info for the bestsellers? After creating a test order I would like to take the number ordered down one so it does not inflate the best seller list.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 30