Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
How can we change the order status in the tea commerce backend when an order is finalized or before finalized?
I need to change the status by code when an order is completed.
Probably your best bet is to hook into the Finalizing event to be notified when an order is just about to be finalized. The sender argument for the event is the order in question, so within the handler, you should be able to set the orders OrderStatusId from there.
If you do set it within the finalizing event, this is before the order is saved so you shouldn't need to call .Save() yourself, however as the finalizing event is the last event to run, setting the order status ID from within the finalizing event, won't fire the OrderStatusChanging event should that be something you are relying on. The OrderStatusChanged should still fire though, post persistence, so it may be you can use that instead if you are using it.
Thanks, Matt :)
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted