Magento Wizard
Latest Stories: 

Write articles for us and make money!  Make Money

Delete Test Orders in Magento

 Add to Favourites   Email This Post Email This Post
 Very handy...  This Blog WASN\'TThis Blog WAS
Loading ...

I found it pretty crazy that, throughout my travels with Magento, I still hadn’t found a way to delete test orders.  These orders were contributing towards the overall sales figures for the month, which is not ideal.

Crazily, there is not an easy way to get rid of these orders in Magento, and the Cancel button does not erase this data.  However, if you have access to PHPMyAdmin, you can simply cut and paste a MySQL query that will do the job for you…

Simply paste…

set @increment_id='100000001';
select @order_id:=entity_id from prefix_sales_order_entity where increment_id=@increment_id;
delete from prefix_sales_order_entity where entity_id=@order_id or parent_id=@order_id;
delete from prefix_sales_order where increment_id=@increment_id;

..changing prefix_ for any database table prefix (if you use any), and 100000001 for the actual order number in question.  This should successfully do the job for you.

Digg   del.icio.us   Facebook   Google   LinkedIn   Live   Reddit   StumbleUpon   Technorati   TwitThis  

about the author

    This article was written by Sam Davis on October 15, 2008.
    Computing over a glass of Grenache Shiraz... again!
    Sam encourages you to make money by writing articles for us! Learn More

related articles

 Export list of Magento orders in CSV format
 Magento Admin System - Video Guide
 Setting Catalog Prices Rules in Magento
 Cannot upload images in on Magento Product Page
 Site-wide Catalog Price Rules do not over-ride Special Prices!

comments

2 Responses to “Delete Test Orders in Magento”

  1. Quentin on October 15th, 2008

    I would love to say that this sql works but it has caused major problems for us in the past. After deleting an order using this, when a new customer signs up and orders they are assigned the address from the previously deleted order and other wiered functionality.

  2. Lee Taylor on November 17th, 2008

    Hi all,
    For a working version of the following:
    + How to delete Magento test data
    + How to change prefix for orders, invoices, shipments, and credit memo’s

    Please visit this url: http://eliasinteractive.com/blog/magento-ecommerce-how-to-reset-all-test-order-information-and-set-unique-prefix-for-orders-invoices-shipments-and-credit-memos/

    And leave some feedback =)
    We’d be glad to hear from you!
    - Lee Taylor

Leave a Reply





Translate Inline - Easy Manipulation of Your Magento Store
    Magento Hosting
    Magento Themes
    Just wanted to say that Inline translating is the best thing ever. I love magento....
  • Sponsored Ads

  • The New Blasted Thing

    Blasted Thing has recently undergone an essential re-design, as we prepare to welcome a host of new features in to our web-site.

    We will continue to be gathering useful articles, tutorials and advice regarding Magento - and we'll be focusing on a number of hosting and theme companies which we have independently verified.

  • Translate this page

    Translate