I am working on Magento 1.7 version. I placed a order and make payment using Paypal and refund the amount offline. Order status changed following:-
Order Status is still showing processing but it should be completed.
In Magento, an order is only marked as Complete once you create an invoice and shipment for it. When you create a credit memo for an order, it instead would be marked as Closed.
If you try to set an order as complete or closed directly using the setStatus
method, you will get an exception: The Order State "complete" must not be set manually. Again, these states should be set automatically by Magento.
That being said, if you really want to set these manually, you can get around it like so:
$order->setData('state', 'complete');
$order->setStatus('complete');
$history = $order->addStatusHistoryComment('Manually set order to Complete.', false);
$history->setIsCustomerNotified(false);
$order->save();
You can have a look at this stackoverflow thread for some more info.