2

I have a order with the 'complete' status. I need to change it to a custom status.

I tried below code;

$orderId = '1000000055';
$order = Mage::getModel('sales/order')->load($orderId, 'increment_id');
$order->setState('custom_status_code', true);
$order->save();

But that not working. Can anyone please help me to solve this issue.

2 Answers 2

1

As a suggestion create a status of state complete then assign than custom status.

$orderId = '1000000055';
$order = Mage::getModel('sales/order')->loadByIncrementId($orderId);
$order->setStatus('custom_status_code');
$order->save();
0
0

custom order statuses can be configured via the backend. Navigate to System -> Order Statuses and here you can create your custom order status there. Then you can save order using @Amit Bera's code.

you can also get help from here:- http://codelea.com/9xzA1xWDKgpQ/change-order-status-in-magento-via-sql.html
or
http://www.techytalk.info/programmatically-add-new-order-state-and-status-in-magento/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.