ZiedDams Posted February 21, 2022 Share Posted February 21, 2022 hi i want to execute custom code after an order is payed what should i do ? Link to comment Share on other sites More sharing options...
RensR Posted February 21, 2022 Share Posted February 21, 2022 (edited) Hello, if you want to execute the code when you create the order you can use the 'paymentReturn' hook. If you want to execute a code when you change the status of the order you can use the hook "actionPaymentConfirmation" If you have a custom order State u should check if the option "Turn order as Paid" is true. Edited February 21, 2022 by RensR (see edit history) 1 Link to comment Share on other sites More sharing options...
ZiedDams Posted February 21, 2022 Author Share Posted February 21, 2022 Just now, RensR said: Hello, if you want to execute the code when you create the order you can use the 'displayOrderDetail' hook. If you want to execute a code when you change the status of the order you can use the hook "actionPaymentConfirmation" If you have a custom order State u should check if the option "Turn order as Paid" is true. thank you so much for your time and solutions 😀 , I was actually using the hook ActionOrderStatusUpdate and test on the new OderState is payed or not, But i think the hook actionPaymentConfirmation is better because i will not check if the order is payed . Link to comment Share on other sites More sharing options...
RensR Posted February 21, 2022 Share Posted February 21, 2022 I'm happy for help you, Some people report that they had to make modifications to this hook when using "Custom order states". if you have any problem you can check the code in /classes/order/orderHistory.php changeIdOrderState() 1 Link to comment Share on other sites More sharing options...
ZiedDams Posted February 21, 2022 Author Share Posted February 21, 2022 Thank You Again 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