Skip to content
Tags

Clean way of deleting orders in Magento

September 20, 2011

If you prefer to use an extension to add a «Delete» option on the orders list, see the Seamless Delete Order extension.

But if you want to do it by your own using the Magento functions, it’s quite easy. Just use something like this (this function would delete all orders, so don’t apply it directly!):

foreach(Mage::getModel('sales/order')->getCollection() as $order)
{
    $order->delete();
}
Advertisements

From → Extensions

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: