Normally Magento does not permit changing an order state to COMPLETE or CLOSED directly. Instead, you receive an error message (The Order State “complete” must not be set manually). You can work around this by overriding Order.php and View.php.

1. \app\code\local\Namespace\Modul\Block\Adminhtml\Sales\Order\View.php and add the following lines:

2. \app\code\local\Namespace\Modul\Model\Sales\Order.php and override the setState method as follows:

3. Add the following lines to your module’s config.xml:

4. You can now set the state in a controller, for example:

Setting the order state to Complete or Closed
Need help implementing this solution, or still looking for a fix to your Magento problem? Get in touch and I will be happy to help with your project.
Tags: