Pierre.CIHOLAS Posted January 11, 2012 Share Posted January 11, 2012 Hello, First, thank you for your forums and the documentation section of your website, I learnt a lot about Prestashop in there. I set up Prestashop on my server and I use prestashop to sell tickets (with a unique number on each ticket, saved in a mysql DB with Prestashop tables). I just want to add some actions when orders placed on Prestashop are paid (when the payment is accepted, regardless of the payment method of course). I was about to modify the PaymentModule class (classes/PaymentModule.php) and add my actions in there. Would it works ? It will be problematic when I will update Prestashop to the lastest version (the file will probably be erased). What is the best way to add actions when the payment of an order is accepted ? Thank you in advance for your answers. Link to comment Share on other sites More sharing options...
bellini13 Posted January 11, 2012 Share Posted January 11, 2012 you can override the payment module class, this way you do not lose your changes. you just need to confirm the changes work on newer versions. there might also be a hook on status updates, you could try exploring that as well Link to comment Share on other sites More sharing options...
vinaym Posted January 12, 2012 Share Posted January 12, 2012 if i have to do this, then i would have made a module and used the hookPaymentReturn and checked the valid status of the order supplied in the params.. Link to comment Share on other sites More sharing options...
bellini13 Posted January 12, 2012 Share Posted January 12, 2012 that assumes that the payment status moves to accepted at the point of order completion, right? does hookPaymentReturn get invoked during status changes in the back office? Link to comment Share on other sites More sharing options...
vinaym Posted January 12, 2012 Share Posted January 12, 2012 not always, have to check the valid status of the order available in params as per my understanding of prestashop, major hooks are only executed for front office, only few are for back office admin page, although code can be tweaked to do so. And this is not executed in backoffice state change of orders. Link to comment Share on other sites More sharing options...
mehnihma Posted March 14, 2013 Share Posted March 14, 2013 Hi I am interested also how to add a action when confirming payment, like send additional email or such Link to comment Share on other sites More sharing options...
Mirm Posted November 25, 2013 Share Posted November 25, 2013 (edited) I want to do the same thing. I was hoping the hook "actionPaymentConfirmation" would do this for me. Running through with XDebug but the hook is never called when I set the order-status to "payment accepted" nor "payment remotly accepted". Rather new to Prestashop. Am I missing something? public function install() { if (!parent::install() || !$this->registerHook("actionPaymentConfirmation")) { return false; } return true; } public function actionPaymentConfirmation($params) { ...// some code here, but function is not being invoked } Edited November 25, 2013 by Mirm (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted November 26, 2013 Share Posted November 26, 2013 you could also try "actionOrderStatusUpdate" hook. Both of these hooks are called when the order status is changed. "actionOrderStatusUpdate" is called for any status change, "actionPaymentConfirmation" is only called for "PS_OS_PAYMENT" and "PS_OS_WS_PAYMENT" 1 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