Jump to content

Help with hook before account creation


Recommended Posts

Hey guys, what's up?

 

I'm not a PrestaShop developer, i work with WordPress themes and plugins, but one of my clients asked me to develop a cellphone validation module, like those ones which send SMS or a Phoncall with a number.

 

Well i've already integrated with the SMS gateway, but i don't know how to hook this into the account creation form.

 

I was reading PrestaShop documentation and i've found here: http://doc.prestashop.com/display/PS14/Creating+Modules#CreatingModules-SavingtheConfigurationPageSettings

 

Some hooks, but any of theses hooks allows me to prevent from fake account creation.

 

So, please, do you have any idea of how may i create a SMS or Phonecall validation in te moment that the user enters his cellphone number on the account creation form?

 

Thank you very much ;)

Link to comment
Share on other sites

Hello
you can use hook named ActionBeforeSubmitAccount
add there code to validate the number:
 

$phone_nb = 123456789;
if ($this->your_validate_function($phone_nb) == true) {
  return;
} 
else 
{
  $this->context->controller->errors[] = $this->l('Incorrect phone number');
}
  • Like 1
Link to comment
Share on other sites

 

Hello

you can use hook named ActionBeforeSubmitAccount

add there code to validate the number:

 

$phone_nb = 123456789;
if ($this->your_validate_function($phone_nb) == true) {
  return;
} 
else 
{
  $this->context->controller->errors[] = $this->l('Incorrect phone number');
}

 

Thanks, but this allows me to create a page with a form to validate the phone number? Because i need to create a page where the user inputs his phone number and select if he wants to validate on a phone call or SMS and then a code will be sent to his cellphone and he must input his code on another form for validation,

 

So is it possible to create pages into the hooks?

 

Sorry about my knowledge in PrestaShop, it's my first time with it.

 

Thank you very much!

Link to comment
Share on other sites

This requires custom development of front controller where you will create a register form with whole pre-process scripts and account creation.

unfortuantely, it is not as easy as modification of default register form.

  • Like 1
Link to comment
Share on other sites

This requires custom development of front controller where you will create a register form with whole pre-process scripts and account creation.

unfortuantely, it is not as easy as modification of default register form.

 

Do you have any tutorial or something like that about this development?

 

Thank you very much :D

Link to comment
Share on other sites

 

Hello

you can use hook named ActionBeforeSubmitAccount

add there code to validate the number:

 

$phone_nb = 123456789;
if ($this->your_validate_function($phone_nb) == true) {
  return;
} 
else 
{
  $this->context->controller->errors[] = $this->l('Incorrect phone number');
}

Hi, i was almost finishing my module, but i found out that this hook ActionBeforeSubmitAccount don't exists on my version which is 1.4, so is there anyother hook that i may use?

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...