Go on your opencart dashboard and on the left hand panel click on customers, this will show a drop down menu and you need to click custom fields.
Where to find custom fields. |
Custom Name Field - Title (this is the name of what you want to call the custom field).
Location - This needs to be set to account, unless you want to add it to the address part of the registration form.
Type - I have chosen select, this gives you a drop down box.
Customer Group - Make sure you have this ticked (as originally I didn't and sat for a while wondering why it wouldn't work).
Required - I have this ticked, this is so the customer who is registering has to choose a title before they can move to the next page.
Status - Make sure this is enabled.
Sort Order - I have this set at 1 as it is what I wanted at the top of the form.
Custom Field Value Name - For each title you need to create a new value.
Then click save.
What the custom field should look like. |
I also wanted to create a date of birth field, create a new custom field. Only a few things are different to the title field you have just made.
Custom Name Field - I called it Birthday.
Location - I have this set to account.
Type - I have chose date.
Value - This box shows once you have selected date in type. I have typed tomorrows date 05/09/2016 (the reason being, I thought that that was todays date, I am ahead of my self).
Customer Group - This needs to be ticked again.
Required - I have also ticked this box.
Status - Enabled.
Sort Order - I have set this to 4, as i wanted it to be after the field last name.
Click save.
Date of Birth Field |
Additional to title and birthday, I wanted to add a gender field. Create a new custom field.
Custom Name Field - I called it Gender.
Location - I have set this to account.
Type - I have chosen radio.
Customer Group - Make sure this is ticked.
Required - I have this ticked.
Status - Enabled.
Sort Order - I have set this to 5 so it is under the birthday field.
Custom Field Value Name - I created a male, female and not applicable, make sure each has its own value.
Click save.
Gender. |
What the registration form looks like with the fields added. |
I noticed that the registration form had fax and company name on the registration form, I wanted to remove this.
To do so you need to access your cPanel file manager and find register.tpl (public_html/catalog/view/theme/default/template/account/register.tpl).
To remove the fax field from the registration form you need to find the section of code that shows:
<div class="form-group">
<label class="col-sm-2 control-label" for="input-fax"><?php echo $entry_fax; ?></label>
<div class="col-sm-10">
<input type="text" name="fax" value="<?php echo $fax; ?>" placeholder="<?php echo $entry_fax; ?>" id="input-fax" class="form-control" />
</div>
</div>
You need to remove this code (it is found on line 81 - 86).
To remove the company name field from the registration form you need to find the section of code that shows:
<div class="form-group">
<label class="col-sm-2 control-label" for="input-company"><?php echo $entry_company; ?></label>
<div class="col-sm-10">
<input type="text" name="company" value="<?php echo $company; ?>" placeholder="<?php echo $entry_company; ?>" id="input-company" class="form-control" />
</div>
</div>
Remove this code (found on line 238 - 243).
The bottom of the registration form. |
After I had made these changes my social media icons had moved, to correct this stay on the register.tpl. On the line 519 (or if you have kept the fax and company name field 529) add </br>. This is what the code should now read:
<input type="submit" value="<?php echo $button_continue; ?>" class="btn btn-primary" />
</div>
</div>
<?php } ?>
</form>
</br>
<?php echo $content_bottom; ?></div>
<?php echo $column_right; ?></div>
</div>
<script type="text/javascript"><!--
Click save and check your registration page on your store.
Fixed and finished. |
Sam
0 comments:
Post a Comment