Skip to content

Instantly share code, notes, and snippets.

@rgranadino
Created December 4, 2014 23:55
Show Gist options
  • Save rgranadino/a3dfe55f21b347682144 to your computer and use it in GitHub Desktop.
Save rgranadino/a3dfe55f21b347682144 to your computer and use it in GitHub Desktop.
really force magento orders complete
<?php
/* @var $collection Mage_Sales_Model_Resource_Order_Collection */
$collection = Mage::getResourceModel('sales/order_collection');
$reflection = new ReflectionMethod( Mage_Sales_Model_Order, '_setState');
$reflection->setAccessible(true);
foreach ($collection as $order) {
/* @var $order Mage_Sales_Model_Order */
$reflection->invoke($order, 'complete', 'bulk_complete', 'force complete', false, false);
$order->save();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment