I'm working on a module that will import data from a fulfillment service and update the status of orders in the store, such as changing them from Pending to Shipped or Back-Ordered. I took a look in the LSK, and I see that there is a function called Order_Update_Status. But it doesn't accept a parameter for the status. Instead, it examines the order and all the OrderItems, and "calculates" a new status for the order based on all that data.
I would like to use this function, since it provides other useful functionality such as calling all modules with the not_order API feature. But the code is rather complex. Can someone tell me a couple of sentences on the best way to use this function? Do I need to change the status of all the OrderItems first? There is no OrderItem_Update_Status function. although there are several with names of the form OrderItem_Update_Status_SomethingSpecific. Again, I hope someone can save me from needing to study all this code in order to learn the "official" way to update an order's status.
Thanks --
I would like to use this function, since it provides other useful functionality such as calling all modules with the not_order API feature. But the code is rather complex. Can someone tell me a couple of sentences on the best way to use this function? Do I need to change the status of all the OrderItems first? There is no OrderItem_Update_Status function. although there are several with names of the form OrderItem_Update_Status_SomethingSpecific. Again, I hope someone can save me from needing to study all this code in order to learn the "official" way to update an order's status.
Thanks --
Comment