Jump to content

DNI tax number not required but the field shall appear


Recommended Posts

Hello,

we like to use the field DNI id number but we do not want make it required. We figured out the following settings can be made:

  • Localization > Countries > Country-XYZ > DNI necessary? --> is need to be switched on to make the field appear
  • Customer > Addresses > Additional required fields ---> Does not make a difference whether the DNI field is to set to required here ... when the previour option is switched on

Does anyone have an idea how we can make the field appear and not make it required?

 

We found this solution but it didn't help. There was no change to see. Did we make something wrong?

 

Thanks in advance

 

T

Edited by xfdisco (see edit history)
Link to comment
Share on other sites

  • 1 year later...

I am not a programmer but I found a solution. Use it on your own risk...

 

1. Make sure in country setting, DNI necessary is off. and add dni field into address format.

2. Edit file address.tpl.

     Search for dni, you will find something like this.. on the <div class=.....    just remove everything so it is just form-group. Like below.

{if $field_name eq 'dni'}
			{assign var="dniExist" value=true}
			<div class="form-group">
				<label for="dni">{l s='Identification number'} <sup>*</sup></label>
				<input class="validate form-control" data-validate="{$address_validation.$field_name.validate}" type="text" name="dni" id="dni" value="{if isset($smarty.post.dni)}{$smarty.post.dni}{else}{if isset($address->dni)}{$address->dni|escape:'html':'UTF-8'}{/if}{/if}" />
				<span class="form_info">{l s='DNI / NIF / NIE'}</span>
			</div>

3. Do the same for order-opc-new-account.tpl.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...