Customer attribute properties
Customer attributes provide the information that is required to support the order, fulfillment, and customer management processes. Because your business is unique, you might need fields in addition to the default items provided by the system. You can add custom attributes to the Account Information, Address Book, and Billing Information sections of the customer’s account. Customer address attributes can also be used in the Billing Information section during checkout, or when guests register for an account.
{width="700" modal="regular"}
Step 1: Complete the Attribute Properties
-
On the Admin sidebar, go to Stores > Attributes > Customer.
-
In the upper-right corner, click Add New Attribute.
{width="600" modal="regular"}
-
In the Attribute Properties section, do the following:
-
Enter a Default Label that identifies the attribute during data entry.
-
Enter an Attribute Code that identifies the attribute within the system.
The attribute code must begin with a letter, and can include any combination of lowercase letters (a-z) and numbers (0-9). The code must be fewer than 30 characters in length, and cannot include special characters or spaces. The underscore character (
_
) can be used to indicate a space.note tip TIP Shortcut: To complete only the required fields, scroll down to Storefront Properties, enter the Sort Order, and save. -
-
Complete the data entry properties:
-
To determine the type of input control that is used for data entry, set Input Type to one of the following:
table 0-row-2 1-row-2 2-row-2 3-row-2 4-row-2 5-row-2 6-row-2 7-row-2 8-row-2 9-row-2 Type Description Text Field
A single-line text field. Text Area
A multiple-line input field for entering paragraphs of text, such as a product description. You can use the WYSIWYG editor to format the text with HTML tags, or enter the tags directly into the text. Multiple Line
Creates multiple text lines for the attribute, similar to a multi-line street address. The number of separate data entry lines can be from two to 20. Use the Default Value
to specify the initial value of the field.Date
Displays a date value in the preferred date format and time zone. Date values can be selected from a list or a calendar ( ).
Note: Depending on your system configuration, Admin users can enter dates directly into a field or select a date from the calendar or list. For information about specifying date and time values, see Date and time options.Yes/No
Displays a drop-down list with pre-defined options of Yes
andNo
.Dropdown
Displays a drop-down list of values that accepts only a single selection. The Dropdown input type is a key component of configurable products. Multiple Select
A drop-down list that accepts multiple values to be selected. File (attachment)
A field that allows a file to be uploaded and associated with the customer attribute as an attachment. Image File
A field that allows an image to be uploaded to the gallery and associated with the customer attribute. -
If the customer must enter a value in the field, set Values Required to
Yes
. -
To assign an initial value to the field, enter a Default Value.
-
To check the data entered into the field for accuracy before the record is saved, set Input Validation to the type of data to be allowed in the field. The available values depend on the Input Type specified.
table 0-row-2 1-row-2 2-row-2 3-row-2 4-row-2 5-row-2 6-row-2 7-row-2 8-row-2 Value Description None
The field has no input validation during data entry. Alphanumeric
Accepts any combination of numbers (0-9) and alphabetic characters (a-z, A-Z) during data entry. To include special characters, see Escape HTML Entities. Alphanumeric with Space
Accepts any combination of numbers (0-9), alphabetic characters (a-z, A-Z), and spaces during data entry. Numeric Only
Accepts only numbers (0-9) during data entry. Alpha Only
Accepts only alphabetic characters (a-z, A-Z) during data entry. URL
Accepts only a URL during data entry. Email
Accepts only an email address during data entry. Length Only
Validates the input based on the length of the data entered into the field. -
To limit the size of Text Field and Text Area input types, enter the Minimum Text Length and Maximum Text Length.
-
To apply a preprocessing filter to values entered in a text field, text area, or multiple line input type, set Input/Output Filter to one of the following:
table 0-row-2 1-row-2 2-row-2 3-row-2 Value Description None
Does not apply a filter to text entered into the field. Strip HTML Tags
Removes HTML tags from the text. This filter can help clean up data that is pasted into a field from another source that includes HTML tags. Escape HTML Entities
Converts special characters found in the text to a valid HTML escape sequence, such as &;
. Escape sequences are enclosed between an ampersand and a semi-colon, and are frequently used for typographer’s smart quotes, copyright, and trademark symbols. Escape sequences are also used to identify characters such as the less than (<
) and greater than (>
) symbols, and the ampersand character which are also used in the code. This filter can help clean up special characters that are sometimes pasted into database fields from word processors.
-
-
Complete the customer grid and segment properties:
-
To be able to include the column in the Customers grid, set Add to Column Options to
Yes
. -
To filter the Customers grid by this attribute, set Use in Filter Options to
Yes
. -
To filter the Customers grid by text attribute with different filter-matching conditions, set Grid Filter Condition Type to
Partial Match
,Prefix Match
, orFull Match
. It does not affect the Search by keyword field for the grid. -
To search the Customers grid by this attribute, set Use in Search Options to
Yes
. -
To make this attribute available to customer segments, set Use in Customer Segment to
Yes
.
-
Step 2: Complete the storefront properties
-
Scroll down to the Storefront Properties section.
{width="600" modal="regular"}
-
To make the attribute visible to customers, set Show on Storefront to
Yes
. -
Enter a number in the Sort Order field, which determines its order of appearance when listed with other attributes.
-
Set Forms to Use to each form that is to include the attribute. To choose multiple options, hold down the Ctrl key and click each form.
Step 3: Complete the label and save
-
In the left panel, choose Manage Labels/Options.
-
Under Manage Titles, enter a label to identify the attribute for each store view.
-
When complete, click Save Attribute.
{width="600" modal="regular"}
Field descriptions
Attribute Properties
Text Field
- A single-line text field.Text Area
- A multi-line text area.Multiple Line
- Creates multiple text lines for the attribute, similar to a multi-line street address. The number of separate data entry lines can be from 2 to 20.Date
- Displays a date field with a pop-up calendar.Dropdown
- A drop-down list that accepts only one value to be selected.Multiple Select
- A drop-down list that accepts multiple values to be selected.Yes/No
- A field that offers only a choice of Yes
or No
values.File (attachment)
- A field that allows a file to be uploaded and associated with the customer attribute as an attachment.Image File
- A field that allows an image to be uploaded to the gallery and associated with the customer attribute.Yes
/ No
None
- The field has no input validation during data entry.Alphanumeric
- Accepts any combination of numbers (0-9) and alphabetic characters (a-z, A-Z) during data entry.Alphanumeric with Space
- Allows spaces in the street address to comply with maximum length requirements of carrier. During checkout, the customer can enter any combination of numbers (0-9), alphabetic characters (a-z, A-Z), and spaces in the street address of the recipient and sender. Any extra spaces are trimmed when the address is saved.Numeric Only
- Accepts only numbers (0-9) during data entry.Alpha Only
- Accepts only alphabetic characters (a-z, A-Z) during data entry.URL
- Accepts only a URL during data entry.Email
- Accepts only an email address during data entry.Length Only
- Validates the input based on the length of the data entered into the field.None
- Does not apply a filter to text entered into the field.Strip HTML Tags
- Removes HTML tags from the text. This filter can help clean up data that is pasted into a field from another source that includes HTML tags.Escape HTML Entities
- Converts special characters found in the text to a valid HTML escape sequence, such as amp;
. Escape sequences are enclosed between an ampersand and a semi-colon, and are frequently used for typographer’s smart quotes, copyright symbols, and trademark symbols. Escape sequences are also used to identify characters such as the less than (<
) and greater than (>
) symbols, and the ampersand character which are also used in the code. This filter can help clean up special characters that are sometimes pasted into database fields from word processors.Yes
/ No
Partial Match
/ Prefix Match
/ Full Match
Yes
/ No
Storefront Properties
Yes
/ No
Customer Registration
Customer Account Edit
Admin Checkout
Default customer attributes
created_at
updated_at
website_id
store_id
created_in
group_id
disable_auto_group_change
prefix
firstname
middlename
lastname
suffix
email
dob
Important: In keeping with current security and privacy best practices, be aware of any potential legal and security risks associated with the storage of customers’ full date of birth (month, day, year) with other personal identifiers. It is recommended that you limit the storage of customers’ full birth dates and suggest using customer year of birth as an alternative.
taxvat
VAT Number
. The VAT number field is always present in all shipping and billing customer addresses when viewed from the Admin, but is not a required field.gender
Customer attributes demo
For a demonstration of creating customer attributes, watch this video: