Post by Live_Life » Sat Nov 11, 2023 5:40 am

Remove Telephone Required from Initial Customer Registration How to

OpenCart ver 3.0.3.8 and probably others

Make back copies before modifying files. Twigs can be reset.

shop > catalog > controller > account > register.php
Delete lines 237 to 239

Code: Select all

if ((utf8_strlen($this->request->post['telephone']) < 3) || (utf8_strlen($this->request->post['telephone']) > 32)) {
			$this->error['telephone'] = $this->language->get('error_telephone');
		}
This gets rid of the requirement to fill out the telephone number line to register a new customer.

To get rid of the telephone line from the new customer registration page.

OpenCart Dashboard > Design > Theme Editor> account > register.twig
Starting Line 67, Delete:

Code: Select all

 <div class="form-group required”>
            <label class="col-sm-2 control-label" for="input-telephone">{{ entry_telephone }}</label>
            <div class="col-sm-10">
              <input type="tel" name="telephone" value="{{ telephone }}" placeholder="{{ entry_telephone }}" id="input-telephone" class="form-control" />
              {% if error_telephone %}
              <div class="text-danger">{{ error_telephone }}</div>
              {% endif %} </div>
          </div>
To keep the Telephone Line but remove the requirement star change this line 67

Code: Select all

<div class="form-group required”> to 
          <div class="form-group”>
This does not get rid of the Telephone entry line in Edit Account or that requirement.

Newbie

Posts

Joined
Sat Apr 22, 2023 3:10 am

Post by straightlight » Sat Nov 11, 2023 7:26 am

OC v3.2 has this feature integrated.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 5 guests