// if you run this code in a shell, see comment below, you have to set this flag
Mage::register('isSecureArea', true);
// select all orders
$orders = Mage::getModel('sales/order')->getCollection();
// select defined orders listed in $orderIds
$orders = Mage::getModel('sales/order')->getCollection()
->addFieldToFilter('entity_id', (array) $orderIds);
foreach ($orders as $order) {
$order->delete();
}
you can run code snippet like above with a php shell as provided in Magento PHP Developer's Guide (p.58)This is my blog about Magento. I'm new to it. Had some hard time to get into it. Especially to find good documentation on the newest version of Magento Community Edition. So i decided to document my way to setup my own nice web shop to help others ;-) You'll find also some mac/os x and python related stuff here
Tuesday, November 25, 2014
How to delete orders
Usually you have after a certain time of developing some test orders that you want go get rid of.
this is a small script to delete them
Labels:
delete orders,
Magento 1.9+,
order
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment