Call-back icon  Sales: Call 800.374.8146 (N America)|757.278.0920 (International)

Magento

Open Source eCommerce Evolved

Magento Forum

   
Page 2 of 5
How to delete orders complete? 
 
I'm Done
Member
 
Total Posts:  32
Joined:  2008-05-08
 

I would like to know this as well. Where on that table in the database is the order I’m deleting? I’m surprised there is no option from the admin panel because the store owners may need to delete orders and know nothing about accessing databases.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Yoke Lee
Member
 
Avatar
Total Posts:  71
Joined:  2008-05-08
China
 

How about reinstall Magento database with a clean master database?  cool smirk

means you already fill in the database with all complete products and categories, but no order or transaction at all.

or flush the order table maybe?

 Signature 

Hope it helps ! And please share with us if it is ! Thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Danielc1234
Sr. Member
 
Avatar
Total Posts:  116
Joined:  2008-01-09
Miami, FL - United States
 

Moshe - I used your sql script to delete like one or two test orders, but now in the Sales > Orders I see the new order, but when you go to view the order, the new order is all messed up. I looks like it has the wrong billing/shipping info and there are orders on the new order that was from the old order that was supposed to be deleted. The shipping/billing info is from the deleted order as well.
Any ideas on how to fix this? I would appear that I cant send out any emails to this new order because it is showing all the wrong data.
Please help.
Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
karynn
Member
 
Avatar
Total Posts:  69
Joined:  2008-02-07
 

Yes, please, I think we all need to know how to do this, since it’s not a built in action.

 Signature 

Heritage Gallery Fine Art & Frames

 
Magento Community Magento Community
Magento Community
Magento Community
 
lazzymonk
Sr. Member
 
Avatar
Total Posts:  250
Joined:  2008-04-03
England
 

It would be nice if there was a button that would remove everything expect settings categories and products.

remove all orders, customers, reviews, search terms, all of it.

or just orders would do for now :D

 Signature 

If someone tells you its impossible, try anyway or you will never know.

Currently removing bugs from my blog extension.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Danielc1234
Sr. Member
 
Avatar
Total Posts:  116
Joined:  2008-01-09
Miami, FL - United States
 

I want to bump this up again...I have not figured out what is going on and NEED some help!!!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
iceburn004
Jr. Member
 
Total Posts:  6
Joined:  2008-05-18
Sydney
 

Hi, please use at your own risk, it works so far, i haven’t found any problems with it yet. it will reset, order,invoices,shipment and customers, most viewed and other stuff.
But it doesn’t reset the orderID, for the life of me i can’t figure out where they get the increment_id from

Tested and used on MySQL 4.1.22

Use at your own risk! and Backup your DB.

TRUNCATE `sales_order`;
TRUNCATE `sales_order_datetime`;
TRUNCATE `sales_order_decimal`;
TRUNCATE `sales_order_entity`;
TRUNCATE `sales_order_entity_datetime`;
TRUNCATE `sales_order_entity_decimal`;
TRUNCATE `sales_order_entity_int`;
TRUNCATE `sales_order_entity_text`;
TRUNCATE `sales_order_entity_varchar`;
TRUNCATE `sales_order_int`;
TRUNCATE `sales_order_text`;
TRUNCATE `sales_order_varchar`;
TRUNCATE `sales_quote`;
TRUNCATE `sales_quote_address`;
TRUNCATE `sales_quote_address_decimal`;
TRUNCATE `sales_quote_address_int`;
TRUNCATE `sales_quote_address_text`;
TRUNCATE `sales_quote_address_varchar`;
TRUNCATE `sales_quote_decimal`;
TRUNCATE `sales_quote_entity`;
TRUNCATE `sales_quote_entity_datetime`;
TRUNCATE `sales_quote_entity_decimal`;
TRUNCATE `sales_quote_entity_int`;
TRUNCATE `sales_quote_entity_text`;
TRUNCATE `sales_quote_entity_varchar`;
TRUNCATE `sales_quote_int`;
TRUNCATE `sales_quote_item`;
TRUNCATE `sales_quote_item_decimal`;
TRUNCATE `sales_quote_item_int`;
TRUNCATE `sales_quote_item_text`;
TRUNCATE `sales_quote_item_varchar`;
TRUNCATE `sales_quote_rule`;
TRUNCATE `sales_quote_text`;
TRUNCATE `sales_quote_varchar`;
TRUNCATE `sendfriend_log`;
TRUNCATE `tag`;
TRUNCATE `tag_relation`;
TRUNCATE `tag_summary`;
TRUNCATE `wishlist`;
TRUNCATE `log_quote`;
TRUNCATE `report_event`;

ALTER TABLE `sales_orderAUTO_INCREMENT=1;
ALTER TABLE `sales_order_datetimeAUTO_INCREMENT=1;
ALTER TABLE `sales_order_decimalAUTO_INCREMENT=1;
ALTER TABLE `sales_order_entityAUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_datetimeAUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_decimalAUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_intAUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_textAUTO_INCREMENT=1;
ALTER TABLE `sales_order_entity_varcharAUTO_INCREMENT=1;
ALTER TABLE `sales_order_intAUTO_INCREMENT=1;
ALTER TABLE `sales_order_textAUTO_INCREMENT=1;
ALTER TABLE `sales_order_varcharAUTO_INCREMENT=1;
ALTER TABLE `sales_quoteAUTO_INCREMENT=1;
ALTER TABLE `sales_quote_addressAUTO_INCREMENT=1;
ALTER TABLE `sales_quote_address_decimalAUTO_INCREMENT=1;
ALTER TABLE `sales_quote_address_intAUTO_INCREMENT=1;
ALTER TABLE `sales_quote_address_textAUTO_INCREMENT=1;
ALTER TABLE `sales_quote_address_varcharAUTO_INCREMENT=1;
ALTER TABLE `sales_quote_decimalAUTO_INCREMENT=1;
ALTER TABLE `sales_quote_entityAUTO_INCREMENT=1;
ALTER TABLE `sales_quote_entity_datetimeAUTO_INCREMENT=1;
ALTER TABLE `sales_quote_entity_decimalAUTO_INCREMENT=1;
ALTER TABLE `sales_quote_entity_intAUTO_INCREMENT=1;
ALTER TABLE `sales_quote_entity_textAUTO_INCREMENT=1;
ALTER TABLE `sales_quote_entity_varcharAUTO_INCREMENT=1;
ALTER TABLE `sales_quote_intAUTO_INCREMENT=1;
ALTER TABLE `sales_quote_itemAUTO_INCREMENT=1;
ALTER TABLE `sales_quote_item_decimalAUTO_INCREMENT=1;
ALTER TABLE `sales_quote_item_intAUTO_INCREMENT=1;
ALTER TABLE `sales_quote_item_textAUTO_INCREMENT=1;
ALTER TABLE `sales_quote_item_varcharAUTO_INCREMENT=1;
ALTER TABLE `sales_quote_ruleAUTO_INCREMENT=1;
ALTER TABLE `sales_quote_textAUTO_INCREMENT=1;
ALTER TABLE `sales_quote_varcharAUTO_INCREMENT=1;
ALTER TABLE `sendfriend_logAUTO_INCREMENT=1;
ALTER TABLE `tagAUTO_INCREMENT=1;
ALTER TABLE `tag_relationAUTO_INCREMENT=1;
ALTER TABLE `tag_summaryAUTO_INCREMENT=1;
ALTER TABLE `wishlistAUTO_INCREMENT=1;
ALTER TABLE `log_quoteAUTO_INCREMENT=1;
ALTER TABLE `report_eventAUTO_INCREMENT=1;

-- 
reset customers
TRUNCATE 
`customer_address_entity`;
TRUNCATE `customer_address_entity_datetime`;
TRUNCATE `customer_address_entity_decimal`;
TRUNCATE `customer_address_entity_int`;
TRUNCATE `customer_address_entity_text`;
TRUNCATE `customer_address_entity_varchar`;
TRUNCATE `customer_entity`;
TRUNCATE `customer_entity_datetime`;
TRUNCATE `customer_entity_decimal`;
TRUNCATE `customer_entity_int`;
TRUNCATE `customer_entity_text`;
TRUNCATE `customer_entity_varchar`;
TRUNCATE `log_customer`;
TRUNCATE `log_visitor`;
TRUNCATE `log_visitor_info`;


ALTER TABLE `customer_address_entityAUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_datetimeAUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_decimalAUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_intAUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_textAUTO_INCREMENT=1;
ALTER TABLE `customer_address_entity_varcharAUTO_INCREMENT=1;
ALTER TABLE `customer_entityAUTO_INCREMENT=1;
ALTER TABLE `customer_entity_datetimeAUTO_INCREMENT=1;
ALTER TABLE `customer_entity_decimalAUTO_INCREMENT=1;
ALTER TABLE `customer_entity_intAUTO_INCREMENT=1;
ALTER TABLE `customer_entity_textAUTO_INCREMENT=1;
ALTER TABLE `customer_entity_varcharAUTO_INCREMENT=1;
ALTER TABLE `log_customerAUTO_INCREMENT=1;
ALTER TABLE `log_visitorAUTO_INCREMENT=1;
ALTER TABLE `log_visitor_infoAUTO_INCREMENT=1;

 
Magento Community Magento Community
Magento Community
Magento Community
 
Danielc1234
Sr. Member
 
Avatar
Total Posts:  116
Joined:  2008-01-09
Miami, FL - United States
 

It Worked!! Thanks a lot.

 
Magento Community Magento Community
Magento Community
Magento Community
 
bloggleme
Member
 
Total Posts:  75
Joined:  2008-05-06
 

How did you get best sellers to show up???

mdumka - 07 May 2008 06:22 PM

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
 
Napier
Member
 
Total Posts:  45
Joined:  2008-05-24
 

Would be nice to be able to manage/delete orders from admin - instead of going into DB

 
Magento Community Magento Community
Magento Community
Magento Community
 
nicolas46
Sr. Member
 
Total Posts:  210
Joined:  2008-04-09
Toulouse
 

Great job iceburn004 !
Can somebody of Varien staff can validate this work and maybe give us more information about a future feature which solve this problem ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
nicolas46
Sr. Member
 
Total Posts:  210
Joined:  2008-04-09
Toulouse
 

Please , Roy, Moshe, Yoav, someone..... smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
jan212
Guru
 
Avatar
Total Posts:  310
Joined:  2008-01-03
 

I’m not from the magento team but i can validate the snipp from iceburn004 as working…
I always recommend a backup before executing raw sql codes...

 Signature 

---
Wichtiger Hinweis: Wer Visionen hat, sollte zum Arzt gehen.
---
Gruß/ Greetings/ Groetjes
Jan F.
---
commercial: null212 | Büro für Kommunikation und Design
privat: Nörd1

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mgjaltema
Jr. Member
 
Total Posts:  5
Joined:  2008-03-24
 

iceburn004, thank you sooo much!! grin

This worked for me too and solved two more strange problems I had with my orders.

Maybe someone else experienced this too, so FYI:

After deleting orders one by one (as described earlier in this thread) I got stuck with two errors:

- Shipping and Billing Addresses were the same for each client! (they were somehow copied from the first order)
- I had a “ghost” item that was added to each order. It was a test product that had been ordered by another testuser before, but that order was canceled. The ghostproduct showed up in every following order as a cancelled order.

I’m not sure if deleting the items one by one caused the errors, but iceburn004’s method works great.

 
Magento Community Magento Community
Magento Community
Magento Community
 
I'm Done
Member
 
Total Posts:  32
Joined:  2008-05-08
 

In the attempt to keep Magento Commerce healthy, we need answers from the Varien team as to if and when this issue will be resolved. Store owners are not going to have the knowledge to go into a database and delete orders, nor would we want them to.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
Page 2 of 5
 
Sales: Call 800.374.8146 (North America) 757.278.0920 (International)
© Copyright 2008 Varien. Magento is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
33268 users|348 users currently online|73919 forum posts