First Name and Surname
Within the registration form you can add a first and last name to acquire more information about the customer. In this article, we show you how to edit and add these fields to your registration form.
Wireframe
Preparation Checklist
Before you start this tweak, it's a good idea to run through our preparation checklist below:
- Read through the Getting Started to get a better sense of how the control panel, Database and Front End store interact.
- Learn our recommended Simple Workflow. This makes the implementation process as easy as possible.
- Create a new Staging Theme for this tweak. This allows you to preview any changes before they are visible to live customers.
- The code snippet in this tweak doc uses Bootstrap 3, you may need to alter this code depending on what version of Bootstrap your theme is using. You can find out what version your theme is using here.
Coding Instructions
Step 1: Open the login template
The login template can be found here /httpdocs/assets/themes/[THEME-NAME]/templates/customer/login.template.html
.
Step 2: Add the code into template
Paste the following code inside the registration form <form>
tag:
<div class="col-xs-12 col-md-6">
<div class="form-group">
<label>First Name</label>
<input type="text" name="reg_bill_first_name" value="[%session id:'reg_first_name'%][%/session%]" size="5" class="form-control" placeholder="First Name">
</div>
</div>
<div class="col-xs-12 col-md-6">
<div class="form-group">
<label>Surname</label>
<input type="text" name="reg_bill_last_name" id="reg_last_name" value="[%session id:'reg_last_name'%][%/session%]" size="5" class="form-control" placeholder="Surname">
</div>
</div>
Step 3: Repeat for the register template
This will also need to be done for the register template. This can be found here /httpdocs/assets/themes/[THEME-NAME]/templates/customer/register.template.html
.