AlexWehe Posted March 29, 2023 Share Posted March 29, 2023 Hi everybody! I'm new in Prestashop, and I'm trying to execute some code when a customer received the order. But I don't find a hook to that order status.Does any one know if that kind of hook exists? Thanks! Link to comment Share on other sites More sharing options...
ps8modules Posted March 30, 2023 Share Posted March 30, 2023 (edited) Hi. Did you mean to start your function when you change the status of the order to delivered in the administration? public function hookActionOrderStatusPostUpdate($params) { $idOrder = $params['id_order']; // ID Order $oldOs = $params['oldOrderStatus']; // previous Order status $newOs = $params['newOrderStatus']; // current ID Order status $myOsShipped = 4; // Shipped $myOsDelivered = 5; // Delivered if ($newOs == $myOsShipped) { // your function after change state to shipped } if ($newOs == $myOsDelivered) { // your function after change state to delivered } } Edited March 30, 2023 by ps8moduly.cz (see edit history) 1 Link to comment Share on other sites More sharing options...
AlexWehe Posted March 30, 2023 Author Share Posted March 30, 2023 3 hours ago, ps8moduly.cz said: Hi. Did you mean to start your function when you change the status of the order to delivered in the administration? public function hookActionOrderStatusPostUpdate($params) { $idOrder = $params['id_order']; // ID Order $oldOs = $params['oldOrderStatus']; // previous Order status $newOs = $params['newOrderStatus']; // current ID Order status $myOsShipped = 4; // Shipped $myOsDelivered = 5; // Delivered if ($newOs == $myOsShipped) { // your function after change state to shipped } if ($newOs == $myOsDelivered) { // your function after change state to delivered } } Thank you ps8moduly.cz, That's what I was looking for, I thought there was a specific hook for it but I see that I have to use hookActionOrderStatusPostUpdate. 1 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