Jump to content

DNI field (fiscal code) appearing also on registration form from abroad!


Recommended Posts

Dear All, I encountered a big problem in my website, running Prestashop 1.6.1.4., www.cartemurali.it.

I put DNI field (=fiscal code field) as mandatory only for ITALIAN nation, because in other countries it is not necessary. I defined the mandatory field as additional in BO, Localizzazione > Nazione > Italia. I added DNI only for Italy, NOT for other countries, please see the screenshot in attachment. 
The problem is the following:
if customers from abroad try to register their address, they are blocked by the message asking for DNI field to be filled, and the form is refreshed showing again Italy as default country, even if I am in the english version of the shop.
Moreover, DNI field appears as mandatory also for customers out of Italy, after checking the module compiling, NOT before.
I checked the file  AddressController.php in /controllers/front/ folder, seems to me that this elseif is wrong, but I am not sure... 
Can you please help me to solve this issue? 
Probably thins is not only a problem of mine.... 
 
// Check country DNI
            if ($country->isNeedDni() && (!Tools::getValue('dni') || !Validate::isDniLite(Tools::getValue('dni')))) {
                $this->errors[] = Tools::displayError('The identification number is incorrect or has already been used.');
            } elseif (!$country->isNeedDni()) {
                $address->dni = null;
            }
        }
Thanks a lot for your kind support 
 
Caterina

 

post-1257091-0-70600400-1479375284_thumb.png

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