senolage Posted August 9, 2012 Share Posted August 9, 2012 Hello everyone, I've been developing with PrestaShop for a while now, and am getting to love it. Already took a peek at the new 1.5 RC2 and it looks pretty amazing. Now to the point of the thread: I'm planing the development of a couple modules to abide to legal requirements in some countries where a certain level of certification and a rather complicated approval process in order for the invoices to be legally valid. So, I intend to integrate with some external service (already certified platforms) to generate the invoices, credit slips, and so on. So, what I would like to know/discuss is the best way to integrate this into PrestaShop (would be great if someone from the development team could join the discussion ). From the documentation and my analysis I couldn't figure out some hookable points where one could hook in order to generate these invoices and use its data. I believe what I'd really have to do is create override classes for: - OrderInvoice - OrderSlip I'm not really sure about the OrderReturn class but I think that wouldn't be required. I'll be developing for PS 1.5 but will probably adapt it to 1.4 as well. Thank you very much for reading. Regards, Dinis Link to comment Share on other sites More sharing options...
bellini13 Posted August 10, 2012 Share Posted August 10, 2012 If you would like to integrate at the point the order is created, then you would want to hook newOrder. You can review the mailalerts module on how to accomplish this. Link to comment Share on other sites More sharing options...
senolage Posted August 10, 2012 Author Share Posted August 10, 2012 I'm not sure there are enough hooks to achieve what I need. I would need to hook to any action that changes a placed order after the point in which it gets validated: Order is validated: communicate with external webservice and generate legal invoice; Validated order changes status - communicate status change:Marked as paid Cancel invoice [*]Product quantities in the order changed - communicate these changes [*]Refund added - create a credit slip in the external service There might also be other actions that I couldn't remember of that might need to get communicated, but these seem to be at least mandatory ones. Link to comment Share on other sites More sharing options...
bellini13 Posted August 10, 2012 Share Posted August 10, 2012 there is the updateOrderStatus hook which receives the order id and the new status id there is updateQuantity which receives the product and order objects there is orderSlip which receives the order object, a list of the products and quantity Link to comment Share on other sites More sharing options...
senolage Posted August 10, 2012 Author Share Posted August 10, 2012 That looks like it coud cover the major integration spots. Thank you for your help. Will try to update the status as I move forward. 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