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

Delete old test sales..? 
 
magentomatt
Member
 
Total Posts:  37
Joined:  2008-08-08
 

while working through my interface with Authorize.net, I had to run a few ‘test sales’ in the frontend which, naturally, recorded as sales in the back end.

Question:

Does anyone know how to delete any or all sales in the system?  All I can do is ‘cancel’ them but it still records as sales.

Not a big deal, it just drives me crazy - that’s all.

Any advice would be appreciated…

 
Magento Community Magento Community
Magento Community
Magento Community
 
necromancer
Jr. Member
 
Total Posts:  23
Joined:  2008-07-27
 

Copied from somewhere on forums:
(btw, do a backup before running it)

SET FOREIGN_KEY_CHECKS=0;

TRUNCATE `catalogsearch_query`; —added
TRUNCATE `catalogsearch_result`; —added
TRUNCATE `log_quote`;
TRUNCATE `report_event`;
TRUNCATE `sales_flat_order_item`;
TRUNCATE `sales_flat_quote`;
TRUNCATE `sales_flat_quote_address`;
TRUNCATE `sales_flat_quote_address_item`;
TRUNCATE `sales_flat_quote_item`;
TRUNCATE `sales_flat_quote_item_option`;
TRUNCATE `sales_flat_quote_payment`;—added
TRUNCATE `sales_flat_quote_shipping_rate`;—added
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_tax`; —added
TRUNCATE `sales_order_text`;
TRUNCATE `sales_order_varchar`;
TRUNCATE `sendfriend_log`;
TRUNCATE `tag`;
TRUNCATE `tag_relation`;
TRUNCATE `tag_summary`;
TRUNCATE `wishlist`;
TRUNCATE `wishlist_item`; —added

-- 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`;

-- Reset all ID counters
-- Some payment gateways need a unique transaction reference for every order,
-- reseting your order ID may result in future transaction errors!
-- (so only do this if you are sure it wont be a problem)
-- TRUNCATE `eav_entity_store`;

SET FOREIGN_KEY_CHECKS=1;

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