4

Is it possible to adjust / remove entry fields on registration page?

Image:

enter image description here

focus.style
  • 5,674
  • 4
  • 18
  • 34

1 Answers1

2

In admin panel go to Customer > Custom Field

Here you can add any custom field you want. Just check Required before saving new field, and enable it. After that you will see it in your registration page.

Removing unnecessary field, like Fax

Open catalog/view/theme/default/template/account/register.tpl

Find following

<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>

Replace it with following (using same name="fax" as above)

<input type="hidden" name="fax" value="" />

Removing necessary field, like Address

Do everything from the previous chapter

Open catalog/view/theme/default/template/account/register.tpl

Find following

<div class="form-group required">
  <label class="col-sm-2 control-label" for="input-address-1"><?php echo $entry_address_1; ?></label>
  <div class="col-sm-10">
    <input type="text" name="address_1" value="<?php echo $address_1; ?>" placeholder="<?php echo $entry_address_1; ?>" id="input-address-1" class="form-control" />
    <?php if ($error_address_1) { ?>
    <div class="text-danger"><?php echo $error_address_1; ?></div>
    <?php } ?>
  </div>
</div>

Replace it with following (using same name="fax" as above)

<input type="hidden" name="address_1" value="" />

Now open catalog/controller/account/register.php

Find private function validate() {, Inside of this function we can see all validations.

Look for

if ((utf8_strlen(trim($this->request->post['address_1'])) < 3) || (utf8_strlen(trim($this->request->post['address_1'])) > 128)) {
  $this->error['address_1'] = $this->language->get('error_address_1');
}

and remove (or comment) it.

focus.style
  • 5,674
  • 4
  • 18
  • 34
  • Thank you for replying. This is the list of fields that i want to remove: Fax, (If this data can be added in the future in the user settings:) Company, Address 1, Address 2, City, Post Code, Country, Region / State – Vadim Melnikov Jul 16 '20 at 15:34
  • Updated the answer with instruction. Look please. – focus.style Jul 16 '20 at 18:50