Page 1 of 1

Make telephone option for 3.x

Posted: Sat Dec 01, 2018 8:29 pm
by godly75
Hi folks,

It's hard to find for the latest version, but how can I remove the mandatory from the telephone and make it an optional field?
We should be able to choose what fields are mandatory in the setting IMO.

Re: Make telephone option for 3.x

Posted: Sat Dec 01, 2018 8:54 pm
by xxvirusxx
From Checkout? Register?

Re: Make telephone option for 3.x

Posted: Thu Jun 27, 2019 4:34 am
by shadav
I am also looking for this.... how to make it not required in both registration and check out

Re: Make telephone option for 3.x

Posted: Thu Jun 27, 2019 5:02 am
by shadav
I think I figured it out, if i missed anything sorry, feel free to add or fix

in the following files
catalog/controller/account/register.php
catalog/controller/account/edit.php
catalog/controller/checkout/register.php
catalog/controller/checkout/guest.php
admin/controller/customer/customer.php

find and remove

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');
		}
then in the following files
catalog/view/theme/YOURTHEME/template/account/register.twig
catalog/view/theme/YOURTHEME/template/account/edit.twig
catalog/view/theme/YOURTHEME/template/checkout/register.twig
catalog/view/theme/YOURTHEME/template/checkout/guest.twig
admin/view/template/customer/customer_form.twig

find

Code: Select all

<div class="form-group required">
            <label class="col-sm-2 control-label" for="input-telephone">{{ entry_telephone }}</label>
remove

Code: Select all

class="form-group required"

Re: Make telephone option for 3.x

Posted: Thu Jun 27, 2019 9:53 am
by letxobnav
for the twig part

Code: Select all

class="form-group required"
you only need to remove required