Post by godly75 » Sat Dec 01, 2018 8:29 pm

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.

Active Member

Posts

Joined
Fri Oct 27, 2017 1:21 am

Post by xxvirusxx » Sat Dec 01, 2018 8:54 pm

From Checkout? Register?

OC 2.3.0.2 | OC 3.0.3.6 | Extensions converted by me | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by shadav » Thu Jun 27, 2019 4:34 am

I am also looking for this.... how to make it not required in both registration and check out

User avatar
Newbie

Posts

Joined
Wed Oct 24, 2012 1:12 am
Location - Westfield, IN

Post by shadav » Thu Jun 27, 2019 5:02 am

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"

User avatar
Newbie

Posts

Joined
Wed Oct 24, 2012 1:12 am
Location - Westfield, IN

Post by letxobnav » Thu Jun 27, 2019 9:53 am

for the twig part

Code: Select all

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

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan
Who is online

Users browsing this forum: No registered users and 26 guests