Jump to content

How to know when a new user makes register to the store?


prestashop_newuser
 Share

Recommended Posts

I expect you mean (action)customerAccountAdd:  (controllers/fromt/AuthController.php)

 

Hook::exec('actionCustomerAccountAdd', array(
'_POST' => $_POST,
'newCustomer' => $customer
));
 
 
 
An example how to use is can be found in :
/modules/blocknewsletter/blocknewsletter.php
 
 
Hope this helps,
pascal.

Share this post


Link to post
Share on other sites

  • 3 weeks later...

 

I expect you mean (action)customerAccountAdd:  (controllers/fromt/AuthController.php)

 

Hook::exec('actionCustomerAccountAdd', array(
'_POST' => $_POST,
'newCustomer' => $customer
));
 
 
 
An example how to use is can be found in :
/modules/blocknewsletter/blocknewsletter.php
 
 
Hope this helps,
pascal.

 

 

How can I get those registered fields values like name, email address, address etc in my module using that hook actionCustomerAccountAdd after a user makes register to the store?

Share this post


Link to post
Share on other sites

Hi newuser

 

 

in blocknewsletter.php you can see an example in action:

 

public function hookActionCustomerAccountAdd($params)
{
    //if e-mail of the created user address has already been added to the newsletter through the blocknewsletter module,
    //we delete it from blocknewsletter table to prevent duplicates
    $id_shop = $params['newCustomer']->id_shop;
    $email = $params['newCustomer']->email;
    $newsletter = $params['newCustomer']->newsletter;
 
in classes/Customer.php you can see the fields a customer has.
 
so you can do things like:
$params['newCustomer']->lastname
 
in classes/Address.php you have a function you can use to get the (first) address of the customer:
public static function getFirstCustomerAddressId($id_customer, $active = true)
 
So you could probably call
$address = Address::getFirstCustomerAddressId($params['newCustomer']->id)
 
 
Hope this helps,
pascal

Share this post


Link to post
Share on other sites

My tuppence worth.

 

In Backoffice, go to Administration->Preferences.

 

Scroll down to the "Notifications". Set "Show notifications for new customers" to Yes.

 

Now when you log into the backoffice you will see new customer registrations at the top left of the screen.

 

No code required.

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More