preoteasa Posted March 3, 2019 Share Posted March 3, 2019 (edited) 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 March 3, 2019 by preoteasa (see edit history) Link to comment Share on other sites More sharing options...
preoteasa Posted March 21, 2019 Author Share Posted March 21, 2019 Here is the module, in case somebody else has the same problem: https://addons.prestashop.com/en/registration-ordering-process/44392-customer-address-at-registration.html Link to comment Share on other sites More sharing options...
Ayush Gupta Posted March 22, 2022 Share Posted March 22, 2022 hi preoteasa, Your code add the fields on register page but it added to identity page of my account too. what if we only need to add field to registration page but not to the identity page. Link to comment Share on other sites More sharing options...
knacky Posted March 25, 2022 Share Posted March 25, 2022 (edited) /* 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. Developers often fail to add a site restriction option to the module settings. Edited March 25, 2022 by knacky (see edit history) 1 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