Jump to content

Make an API call after user register/update


fsalvaggio

Recommended Posts

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 by fsalvaggio (see edit history)
Link to comment
Share on other sites

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...