PrestaShop 1.5/1.6 Customer Addresses Tutorial
How to manage customer addresses in PrestaShop 1.5 and 1.6
In PrestaShop registered customers can add one or more addresses from their customer account settings on the frontend. From the admin panel administrators can add, edit and delete customer addresses, and also set required fields. By default, customers don't have to provide an address during the registration process, but if you want to, you can include the address form on the registration page and require customers to add an address. You can do this by configuring the respective option in the admin panel.
In this tutorial we'll concentrate mainly on managing customer addresses. For general information on managing customers read the tutorial on how to manage customers in PrestaShop 1.5 and 1.6. In the last section of this tutorial there are some more links to other tutorials and articles related to customers.
In this tutorial we'll show you:
- how registered customers can add and edit addresses from the frontend
- how to access the customer addresses section in the admin panel
- how to add customer address
- how to edit customer addresses
- how to delete customer addresses
- how to set required fields for customer addresses
- how to include or exclude the address form from the registration process and how to make the phone fields required or optional
- links to other tutorials and articles on our site about managing customers in PrestaShop
In this tutorial we've used as a basic example PrestaShop 1.6. The screenshots are also from that PrestaShop version. Although the design of the admin panel is different than that of PrestaShop 1.5 the options related to managing customer addresses are practically the same. If there are some differences we'll make notes about that in the tutorial.
Frontend Settings for Managing Addresses
Each registered customer can add and edit their addresses from the account settings on the frontend. Remember that by default customers are not required to provide an address during the registration. They can add one or more addresses at any time once they are registered. If they haven't provided an address, they'll be required to do so during the checkout process for their first order.
It's advisable that you create an example customer account to see what the process is, and then check the various frontend customer account options. After a customer registers and logs in on your site, they'll be able to edit the settings of their account. The customer can access the account settings by clicking on their name on the frontend (with the default PrestaShop themes it's in the upper right corner of the page).The settings are divided into several sections. The one for the addresses is labeled My Addresses:
On the page that opens the customer can add new addresses and edit and delete the existing ones.
As we mentioned, if you want to, you can make it required for customers to add an address during the registration. You can do this from Preferences menu>Customers sub-menu in the admin panel. For more information check the section in this tutorial on how to include the address form on the customer registration page.
Access the Customer Addresses Section in the Admin Panel
The back office of PrestaShop has separate sections for adding and editing customer accounts, for managing customer addresses and for customer groups. To add, edit and delete customer addresses, log into the admin panel and go to Customers menu>Addresses sub-menu:
On the page that opens there's a table that lists all the addresses of all customers.
Add Customer Addresses
To add a customer address from the admin panel, after you log in go to Customers menu>Addresses sub-menu and on the page that opens click on the Add new address button that's in the upper right corner (in PrestaShop 1.5 it's labeled Add new):
This will open the form for adding customer addresses (the form for editing customer addresses is the same):
Note that you can add addresses only for existing customers.
You don't have to configure all options to be able to add the address. The required fields are marked with a red asterisk.
The form contains the options:
- Customer email - in this field type the email of the customer. It has to be the email address of a registered customer. If you don't know it, go to Customers menu>Customers sub-menu and in the table there find the particular customer and check their email address.
If you put in this field an email address that's not registered, you won't be allowed to add the address.
After you put the email address of the customer in the Customer email field and you move to one of the next fields, the fields for first and last name will be automatically filled with the names of the customer associated with the email address.
- Identification Number - this is an optional field in which you can specify any type of identification number.
- Address alias - this option is for a shorter name for the address. It will be used by PrestaShop to refer to the particular address. It's a required field. You can type whatever you want (e.g. Address 3, Second Address, Billing Address, etc.). However if the customer has more than one address, each one has to be with a different alias.
- First Name - as the name suggests, this field is for the first name of the customer associated with the email address that you put in the Customer email field on the same form. By default, when you put the email address in the field Customer email the first and last name should be automatically put in the respective fields.
- Last Name - similarly to the above option, this field is automatically filled after you put the email address of the customer in the field for Customer email.
Note however that you can put different first and last names than the names with which the customer registered the account. The address will still be associated with the same customer account. What links the address with an account is the email address.
- Company - this field is optional. You can put the name of the company for which the customer works or is associated with in any way.
- Address - this field is required and it's for the name of the street, number of building, floor and flat numbers, etc.
- City - in this field simply type the name of the city/town/village.
- ZIP/Postal Code - this field is required. Type the ZIP or postal code corresponding to the address of the customer.
- Country - select the country of the customer.
- State - this field will only be present if the country has states (e.g. the U.S.).
- Home phone and Mobile phone - these are two separate fields in which you can put the home and/or mobile phone of the customer. By default, you have to provide at least one number to be able to add the address (this is also true for the address form on the frontend). If you want to make both fields optional, go to Preferences menu>Customers sub-menu and set the option Phone number to No. If you want to, you can make both fields required. For more information on how to do this check the section in this tutorial on how to set required fields on the address form.
- Other - in this text area you can type any information related to the customer address.
After you're ready with the options click on the Save button.
Edit Customer Addresses
To edit customer addresses, go to Customers menu>Addresses sub-menu in the admin panel and in the table with the addresses click on the Edit button for the address that you want to edit:
The edit button in PrestaShop 1.5 is not labeled; it looks like a small pencil.
After clicking on the button the form for editing the address options will appear. The settings are the same as on the form for adding new addresses. For more information on those settings check the section in this tutorial on how to add customer addresses from the backend of PrestaShop.
If you have trouble finding the particular address, you can use the filtering options at the top of the table.
Delete Customer Addresses
To delete a customer address, go to Customers menu>Addresses sub-menu in the back office, click on the arrow that's next to the Edit button for the particular address and from the drop-down menu that expands select Delete:
In PrestaShop 1.5 there's no such drop-down menu. The button for deleting addresses is right next to the one for editing; it's not labeled and it looks like a trash can.
After you click on the Delete button a small window will pop out asking you to confirm that you really what to remove the address.
You can also delete more than one address at the same time. To do this, in the first column of the table that lists the addresses mark the checkbox of each address you want to delete, then from the Bulk actions drop-down menu that's under the table choose Delete selected:
In PrestaShop 1.5 there's no Bulk actions drop-down menu, but there's a button Delete selected under the table.
Set Required Fields for Customer Addresses
Some of the fields that appear on the address form (both on the frontend and backend) are not required by default. If you want to, you can make some of these fields required. To do this, go to Customers menu>Addresses sub-menu and click on the button Set required fields for this section that's under the table with the addresses. This will expand a list of address fields:
To make a field required, mark its checkbox in the list and click on the Save button. This will make it required when adding an address from the frontend and from the backend. For example, the Company option on the address form is not required. If you mark the checkbox for company, it will become required.
Among the other fields that you can make required are those for the home phone and the mobile phone. By default, when an address is added one phone number has to be provided. It doesn't matter whether it's the home or mobile. This is managed with the option Phone number that's available when you go to Preferences menu>Customers sub-menu. Using the options for the required fields however if you want to, you can choose which of the two phone numbers is to be required, or you can make both required. Note that if you make any of the phone fields required this will overwrite the Phone number option in the customer preferences. For example, if you make the phone fields optional by setting the Phone number option to No, but you make one or both phone fields required using the checkboxes described above, then the phone field(s) will be required.
With some minor code changes it's also possible to remove one or both phone fields completely from the frontend address form. In this tutorial we've included a section with links to other tutorials and articles on managing customers. There you'll find links to the articles that will show you how to do that.
Add and Remove the Address Form from the Registration Process and Make the Phone Fields Optional or Required
As we already mentioned, customers are not required to add an address during the registration process. After the account is created they can do that from their account settings. The address form contains a couple of fields for phone numbers: one for a home phone number and another for a mobile phone. When a customer adds an address they are required to provide at least one phone number by default.
In the admin panel of PrestaShop there are settings with which if you want to, you can include the address form on the frontend registration page, and you can make the phone fields optional.
To do this, go to Preferences menu>Customers sub-menu in the admin panel. On the page that opens there's an option labeled Registration process type, and another one labeled Phone number:
From the drop-down menu Registration process type you can select whether customers should be required to add an address during the registration process. The Phone number option is enabled by default. This means that when a customer address is added at least one phone number, either home or mobile, should be provided. If you want both phone numbers to be optional, set the Phone number setting to No. It applies not only to the registration process (if the address form is included there), but also to the address form in the frontend customer account settings and the form for adding/editing addresses in the admin panel. It's also possible to select whether the home or the mobile phone in particular should be required, or you can make both required. For more information check the section in this tutorial on how to set required customer address fields.
For more information on the rest of the general customer settings that are on the same page as the ones for the phone number and for changing the registration type check the section on the general customer settings in the tutorial on how to manage customers in PrestaShop.
Links to Other Tutorials and Articles on Managing Customers in PrestaShop
We have a general tutorial on managing customers and another one on managing customer groups. If you want to export customers and addresses (as well as other data) from one PrestaShop instance and import them into another, we have a tutorial about that too:
- how to manage customers in PrestaShop
- how to manage customer groups in PrestaShop
- how to export and import data in PrestaShop
In our knowledge base we have also separate articles on various topics related to managing customers:
- how to make optional or remove the phone fields from the customer registration form in PrestaShop
- how to make optional or remove the phone fields from the customer account settings in PrestaShop
- how to remove the Company field from the registration form and the customer account settings in PrestaShop
- how to enable guest checkout in PrestaShop
- how to export customer information from PrestaShop using phpMyAdmin