Magento WizardNo joke, this website relaunches on 1st April. New look, new features!

Contact the site  Make Money

Delete Test Orders in Magento

 Add to Favourites  
(-1 rating, 3 votes)
Loading ... 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 is the Editor of Blasted Thing. Contact Us

related articles

 Product Tags on Product Page - Video Guide
 Template Path Hints - Video Guide
 Disable Cache while developing your site - Video Guide
 Import/Export Data with Profiles - Video Guide
 Google Base Integration - Video Guide

comments

4 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

  3. Morf on July 11th, 2009

    Are you sure, this is working corectly at actual version of Magento (1.3.x)? Thanks for renspose.

  4. Ray Bogman on August 28th, 2009

    Well check this, a total solution for deleting Magento order “Delete Any Order”

    https://www.yireo.com/software/delete-any-order

Leave a Reply




Spam protection by WP Captcha-Free


Translate Inline – Easy Manipulation of Your Magento Store

  • Sponsored Ads

  • Magento Themes
    • vtiger: great article, thank you....
  • Recent Tweets

    Magento - enlargement surgery penis free Levitra Levitra multiple ...: Magento is the eCommerce software platfo.. http://bit.ly/cefRSW

    Magento Commerce development and design contact eWAVE Australia http://bit.ly/aqOjZL

    #Magento Build and Install http://bit.ly/aqSvjt #freelance #jobs #magento

    #Magento: Account not created until Checkout Success http://bit.ly/dpYBB0 #freelance #jobs #magento

    * Surprised at the traffic Magento shopping cart site gets (web's top 1500 sites) Finally checking it out now, any experts here?