Posted on 07/09/2023 12:48:22
Hi Tomas,
Do you mean manually changing the order state? You sort of can do that. We do it all the time to test Email templates associated with an order state.
For example, we have a state called "Shipped and Invoiced", which has an email template associated. When debugging the template, we update the order state to "New" (or some other state" and then update it back to "Shipped and Invoiced" and the email is triggered again.
If you need to do that in code, there is a sort of a hack, which is to update the OrderStateId (to the "New" one or even blank), save the order, and then set it back again, which is basically mimicking the manual process (although I'm not even sure if you have to save the order between updating the property - it may not have to do that).
In either case that will "polute" the logs and/or may trigger other things if you have any custom notifications subscribers.
Is that what you are trying to do?
Best Regards,
Nuno Aguiar