fsalvaggio Posted November 14, 2017 Share Posted November 14, 2017 (edited) Hi, I have a question: I need to call an external API (the ERP, to store or update user in his DB) when a new customer is finishing his registration or when is finishing to update his profile. Do you have any suggestion to manage these events? I have the API call ready, but actually I don't know where/how to store them... Any help? Edited November 14, 2017 by fsalvaggio (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted November 15, 2017 Share Posted November 15, 2017 You would create a module in Prestashop. In the module you would register hooks (which will notify your module of the event), and then inside you module you can call whatever external API you need to call. You can explore the documentation on the Prestashop website on how to create modules Link to comment Share on other sites More sharing options...
fsalvaggio Posted November 15, 2017 Author Share Posted November 15, 2017 Solved using an override of CustomerCore add and update. I called from parent and added the API call. For example: class Customer extends CustomerCore { public function add($autodate = true, $null_values = true){ parent::add($autodate, $null_values); // My code return $success; } } I made the same for Customer update and AddressCore. Anyway, thanks. 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