// 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)
No comments:
Post a Comment