cedricfontaine Posted January 5, 2012 Share Posted January 5, 2012 I'm trying to send order to shipwire when order status has been changed (payment is accepted for example). So I create a hook public function hookpostUpdateOrderStatus($params) { if ($params['newOrderStatus']->logable) { My problem is that if I wish to update order status at the end of my hook to a custom status (transmitted to Shipwire) it is added to my order after Payment accepted, so it's not the current status. I thought that postUpdateOrderStatus would be called after status has been changed ? Link to comment Share on other sites More sharing options...
Fabien Serny Posted January 6, 2012 Share Posted January 6, 2012 Hi Cedric, The hook postUpdateOrderStatus is called after status has been changed. I'm not sure what you're trying to do. When you say you created a hook, you meant you register your module on a hook, right ? You want to send your order to shipwire when the status is payment accepted. Did you try something like this ? public function hookpostUpdateOrderStatus($params) { if ($params['newOrderStatus']->id == Configuration::get('PS_OS_PAYMENT')) { // Send order to shipwire } } Link to comment Share on other sites More sharing options...
cedricfontaine Posted January 6, 2012 Author Share Posted January 6, 2012 Yes, that's exactly what I did, but I also want to change the status to the state Preparation in progress. Problem is that if in my hook hookpostUpdateOrderStatus, I change the status of the order, at the very end, I have the wrong order : 01/5/2012 15:30:41 Payment accepted 01/5/2012 15:30:40 Preparation in progress Why the new status is in the wrong position ? Link to comment Share on other sites More sharing options...
ifyoumakeit Posted December 11, 2013 Share Posted December 11, 2013 Cedric, Did you ever figure out how to fix this? Dealing with the same problem now. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now