0

I've created my own custom status and assigned it to a state.

This works fine if I load an order, set the status and save as in the following:

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

However, when I want to set the custom status after invoicing by observing the "sales_order_invoice_register" event, sometimes it saves the custom status while other times it doesn't.

I'm guessing that sometimes the way Magento sets its own status gets triggered after mine. How would I get my custom status to be set last and not be overridden?

Thanks.

1

You'll want to use the sales_order_invoice_after event and make sure that the status is assigned to the invoicing state as well.

  • Hi @moose how to assign it to invoicing state? – Mujahidh Jan 13 '16 at 11:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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