PrestaShop 1.7 registration form - removing gender box from the registration form


When creating an account PrestaShop 1.7 in its default settings requires the user to enter gender in registration form. We have a choice of two personal titles Mr. and Mrs., and no option to leave this field blank. And here comes the question - how to remove this often unnecessary and unwanted box? 

prestashop 1.7 title

To remove the gender box in the registration form in PrestaShop 1.7 log into your admin panel. In the left menu, in the Configure section choose Shop Parameters and then Customers Settings. On the newly opened page go to the Titles tab. 

 gender form prestashop 1.7

By default, the panel uploads two options to choose from: Mr. and Mrs. In this part of the panel you can delete or edit both titles. You can also add other, new titles if necessary.  To delete the selected title, press the small down arrow next to the edit command. Select delete from the drop-down menu and confirm your selection. Prestashop 1.7 gender

social title prestashop 1.7  

When both values are deleted, the Contact Name box disappears from the registration form.

 social title prestashop 17

 

Adding a new contact name

To add a new field on the form in the upper right corner, select +Add New Social Title.

 adding new field - social title prestashop 1.7

For the new title, you can add a unique name, assign a gender, and add an image. 

The alternative method of removing the Mr. and Mrs. boxes requires changes in the PrestaShop code. In your store directory, find and open the file named classes/form/CustomerFormatter.php. Navigate to the section responsible for the form element related to gender:

gender prestashop 1.7

Comment out the unnecessary fragment as follows:

prestashop 1.7 gender

After making changes, remember to clear the cache. 

 

In order to ensure maximum convenience to users when using the website, this page uses cookie files. Detailed information is available in our Privacy Policy. Click " I agree", so that this information is no longer shown