Jump to content

Adding address fields to the registration form in PrestaShop 1.7.5


Recommended Posts

Hello,

I would like to write a module to add the address fields to the registration page. I managed so far to add them to the form using the hook additionalCustomerFormFields.

I also managed to validate the new fields via validateCustomerFormFields, and access then via actionCustomerAccountAdd. However I don't know how to update the form when the country is changed (update the state field). I see that when I change the country, there is an ajax request to the server, but it is different  from the similar request when adding a new address. I would like if possible to reuse the mechanism implemented when country changes when editing or adding an address. 

 

Edited by preoteasa (see edit history)
Link to comment
Share on other sites

  • 3 weeks later...
  • 3 years later...
/* only order page */
if($this->context->controller->php_self == 'order')
{
	your code
}

/* only identity page */
if($this->context->controller->php_self == 'identity')
{
	your code
}

You can find the site names in SEO.

obrazek.png.2dd70613ea673ae3fa12180468559480.png

Developers often fail to add a site restriction option to the module settings.

Edited by knacky (see edit history)
  • Like 1
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...