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

How to delete orders complete? 
 
infield
Sr. Member
 
Total Posts:  89
Joined:  2007-11-04
San Francisco
 

Not working for me. I am running it with typogento and campaign monitor extensions.

 
Magento Community Magento Community
Magento Community
Magento Community
 
herve@wsa
Member
 
Avatar
Total Posts:  48
Joined:  2008-07-22
United Kingdom
 

I did remove my orders using the code below:

Mage::getResourceModel('sales/order_collection')->delete();

I found this code in magento/app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php

As mentioned previously, back up your database.

Also, my query removed all the orders. You may want to filter out just some specific orders. In this case, I suggest you to get inspired by the code in the script Grid.php

Put this code wherever you want really (at least if it is a one off.. most likely for the matter of removing orders I suppose) as long as the code is used by one page that you know of.
Once used, comment the code or remove it to make sure your orders don’t get removed every time you reload the latter page.

Herve

 
Magento Community Magento Community
Magento Community
Magento Community
 
imagebox
Jr. Member
 
Total Posts:  18
Joined:  2009-02-10
 

I cant even believe that this isnt something that was set up from day one. You mean to tell me that all of my complete order history form the start of the store will have to be present in the admin panel?

I have to actually leave credit card information there! Comon. This is ludicrous.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lisali
Enthusiast
 
Avatar
Total Posts:  889
Joined:  2008-04-28
London, UK
 

BUMP for an EXTREMELY important issue. Where’s Magento staff?

 
Magento Community Magento Community
Magento Community
Magento Community
 
display-stand
Jr. Member
 
Total Posts:  16
Joined:  2008-10-06
 

SQL script from Ross worked for me.  Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
lisali
Enthusiast
 
Avatar
Total Posts:  889
Joined:  2008-04-28
London, UK
 

One should not have to touch the database manually.

It would be great if Varien actually acknowledged this issue.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Rico Winter
Sr. Member
 
Avatar
Total Posts:  108
Joined:  2009-03-20
Leipzig
 
ds_1984 - 05 March 2009 01:12 PM

Look: http://www.magentocommerce.com/extension/873/delete-orders

Daniel

Don’t work?

Sure it work…

Failed to download magento-community/BoutikCircus_DeleteOrders within preferred state “stable”, latest release is version 0.2, stability “beta”, use “channel://connect.magentocommerce.com/community/BoutikCircus_DeleteOrders-0.2” to install
Cannot initialize ‘channel://connect.magentocommerce.com/community/BoutikCircus_DeleteOrders’, invalid or missing package file
Install Errors
Package “channel://connect.magentocommerce.com/community/BoutikCircus_DeleteOrders” is not valid
PEAR ERROR: install failed

Try to enter this instead:

magento-community/BoutikCircus_DeleteOrders-0.2

Its also for other modules, that dont work at MagentoConnect Manager (e.g. ‘Cash on Delivery’)

Greetz Rico

 
Magento Community Magento Community
Magento Community
Magento Community
 
Danimaltron
Jr. Member
 
Avatar
Total Posts:  9
Joined:  2008-01-29
 

Okay, there is a lot of information in this thread. Thank you to everyone who is contributing, and trying to find workarounds. However, why would Varien not add this in? It is silly that they would try to force some sort of procedure on us. It’s out discretion whether we use it or not.

Also, my accountant does not ask for transactions records of anything where money did not actually get exchanged. It simply make no sense. Accounting is about the money. Not someone clicking a button on a site, then closing the browser and never paying you a cent. There is no need to have “records” of that.
Besides, the data from Magento should be entered into a real bookkeping/accounting system anyways. You wouldnt enter in canceled orders.

But I have a question about how to fix something:

In the past, I deleted several orders manually from the database. I read how to do this on another thread.
I recently found problems with some orders have incorrect shipping addresses and ghost products showing up on the orders.

However, I just placed a test order and it was correct. Will this problem fix itself, or must I run some SQL command to fix the increment #?
If so, could someone please point out which code from this thread I should use. I do not wish to delete any customers, search stats, wishlists, etc. I just want to get all new orders functioning properly.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
kaamiljj
Sr. Member
 
Avatar
Total Posts:  125
Joined:  2009-03-15
Kapaa
 

http://www.magentocommerce.com/extension/873/delete-orders

IT DOES NOT WORK. It seems like it does but it leaves all kinds of crap in the database and you end up with mixed up orders and errors on checkout pages. I had to manually edit the database, column by column to make sure there is nothing remaining and the problem went away. So I only use that extension to get rid of the order from Magento admin menu, then I go to DB and remove all remaining entries related to deleted orders.

It’s pretty ridiculous that it’s still not part of Magento. If Magento team doesn’t do it people will still figure a way around. But why make people spend hours playing with Sql queries when you could do it by modifying your code.

 
Magento Community Magento Community
Magento Community
Magento Community
 
GeraldS
Jr. Member
 
Avatar
Total Posts:  27
Joined:  2008-09-12
Zevenaar
 
kaamiljj - 13 April 2009 12:58 PM

http://www.magentocommerce.com/extension/873/delete-orders

IT DOES NOT WORK. It seems like it does but it leaves all kinds of crap in the database and you end up with mixed up orders and errors on checkout pages. I had to manually edit the database, column by column to make sure there is nothing remaining and the problem went away. So I only use that extension to get rid of the order from Magento admin menu, then I go to DB and remove all remaining entries related to deleted orders.

It’s pretty ridiculous that it’s still not part of Magento. If Magento team doesn’t do it people will still figure a way around. But why make people spend hours playing with Sql queries when you could do it by modifying your code.

Annyone a good solution? I used the delete-orders tool and now its all screwed up. There was also a list of SQL commands that i tried. After changing the prefixes of the tables that run to. Orders gone. But i think it wasnt complete. If a costumer orders something they also get in the confirmation (and i in my admin panel) products ordered/canceled before. I only had a few orders, so want to cleanup the database for costumers and orders.
Has annyone a solution please?

Greetz,
Gerald

 
Magento Community Magento Community
Magento Community
Magento Community
 
kaamiljj
Sr. Member
 
Avatar
Total Posts:  125
Joined:  2009-03-15
Kapaa
 

I had same issues with delete orders extension, ended up cleaning the DB manually. Does anybody have a working SQL query for Magento 1.3.0-1.3.1? I need a code where you put the ordet ID and it gets rid of the whole information related to it and increases the incremental ID just to be safe. Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
erenaud
Sr. Member
 
Total Posts:  221
Joined:  2009-01-05
Minden, Germany
 

damn… if I only had know this earlier!!!

One of the solutions was to install your store, configure everything, then make a backup of the database so that you can restore it again later.
This is too late for me know.

I agree, an SQL query where you just enter the order ID to clean everything up would be the best and quickest solution.

 
Magento Community Magento Community
Magento Community
Magento Community
 
zmove
Guru
 
Total Posts:  317
Joined:  2008-04-30
 

I completely subscribe to this thread.

I develop my shop, testing it hardly, orders, invoices, shipment option....

And now, I have a lot of dummy orders, I would like to delete, and as I test invoice, shipment, even the delete order module can do nothing for me.

Don’t want to restart a clean install of magento just to have a clean orders list…

 
Magento Community Magento Community
Magento Community
Magento Community
 
balero
Sr. Member
 
Avatar
Total Posts:  170
Joined:  2009-01-29
埼玉県所沢市
 

None of this has any relevance to deleting test orders. These are not “orders” or “invoices” from “customers.”

Ross - 21 January 2009 03:37 PM

@norbolig - thanks for this post.  In particular I didn’t realise that the “invoice number series shall be unbroken” - that definitely means that no invoices should be deleted once a store is live.

Do you have any official references for this information?

norbolig - 21 September 2008 08:57 AM
An order is an offer from a customer to buy your goods (and if the products are advertised on your web shop with a price, in most instances you will also have an obligation to deliver the goods). First when you produce and send out a invoice to your customer, you have established a record of the purchase in the financial account, and the customer might now dedcuct the purchase cost if they run a business.

In most European countries, the accounting law and guidelines says the following about deleting orders and invoices:

Orders: Based on the agreement you have with the buyer and your general business conditions, you can make any changes you want to an order (including editing it and deleting it). For example add a discount, change the quantity, add a price increase, add the shipping and handling charges, or delete it completely let say if the goods are not deliverable or the customer changes his mind.
If you accept the order you have received from your customer, the purchase order will be matched with a invoice. You should keep a copy of the order for documentation reasons, and the invoice should contain a reference to the order number.

Invoices: Most invoices but not necessarily all will be based on an order. You can also make any changes you want to an invoice, until you send the Invoice to your customer. As soon as you have sent the invoice to a customer, you can only change the invoice by sending out a credit memo.

The invoices must be numbered and the invoice number series shall be unbroken, in order to make it easy to control that no invoices are missing in your book keeping.

So, it would be completely legal if Magento make it possible to delete orders. However, it should not be possible to delete any invoices after they have been sent out to the customers.

One way to do testing with invoices could be to register at dummy customer account (and then include the invoice in your accounting together with an explanation).

It might be different laws and guidelines in different countries.
 
Magento Community Magento Community
Magento Community
Magento Community
 
GeraldS
Jr. Member
 
Avatar
Total Posts:  27
Joined:  2008-09-12
Zevenaar
 
balero - 30 April 2009 12:05 AM

None of this has any relevance to deleting test orders. These are not “orders” or “invoices” from “customers.”

Ross - 21 January 2009 03:37 PM
@norbolig - thanks for this post.  In particular I didn’t realise that the “invoice number series shall be unbroken” - that definitely means that no invoices should be deleted once a store is live.

Do you have any official references for this information?

norbolig - 21 September 2008 08:57 AM
An order is an offer from a customer to buy your goods (and if the products are advertised on your web shop with a price, in most instances you will also have an obligation to deliver the goods). First when you produce and send out a invoice to your customer, you have established a record of the purchase in the financial account, and the customer might now dedcuct the purchase cost if they run a business.

In most European countries, the accounting law and guidelines says the following about deleting orders and invoices:

Orders: Based on the agreement you have with the buyer and your general business conditions, you can make any changes you want to an order (including editing it and deleting it). For example add a discount, change the quantity, add a price increase, add the shipping and handling charges, or delete it completely let say if the goods are not deliverable or the customer changes his mind.
If you accept the order you have received from your customer, the purchase order will be matched with a invoice. You should keep a copy of the order for documentation reasons, and the invoice should contain a reference to the order number.

Invoices: Most invoices but not necessarily all will be based on an order. You can also make any changes you want to an invoice, until you send the Invoice to your customer. As soon as you have sent the invoice to a customer, you can only change the invoice by sending out a credit memo.

The invoices must be numbered and the invoice number series shall be unbroken, in order to make it easy to control that no invoices are missing in your book keeping.

So, it would be completely legal if Magento make it possible to delete orders. However, it should not be possible to delete any invoices after they have been sent out to the customers.

One way to do testing with invoices could be to register at dummy customer account (and then include the invoice in your accounting together with an explanation).

It might be different laws and guidelines in different countries.

OK, but now im here with a screwed up database. I want to clean it and start fresh.
Every time i want to test and order 1 item. It puts 2 other items also in the mail to costumer, so they can get confused.
Please can someone help. Its important. Its the last item i need solved before going live wit my sites.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top