prestashop_newuser Posted March 21, 2015 Share Posted March 21, 2015 Hi, I am using prestashop 1.6. I wanted to know how can I get to know when some user makes register in the store? Is there any kind of hook or something like that? Any help and suggestions will be really appreciable. Thanks Link to comment Share on other sites More sharing options...
PascalVG Posted March 21, 2015 Share Posted March 21, 2015 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. Link to comment Share on other sites More sharing options...
prestashop_newuser Posted April 10, 2015 Author Share Posted April 10, 2015 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? Link to comment Share on other sites More sharing options...
PascalVG Posted April 10, 2015 Share Posted April 10, 2015 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 Link to comment Share on other sites More sharing options...
prestatent Posted April 13, 2015 Share Posted April 13, 2015 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. 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