Jump to content

[URGENT] Register as a new customer - DNI / NIF / NIE is not valid


Recommended Posts

It's because PrestaShop is programmed to only accept Spanish DNI / NIF / NIE numbers by default.

Try changing line 769 of classes/Validate.php from:

if (!$dni)
   return 1;



to:

if (!$dni OR ($dni AND strlen($dni) == 9 AND intval($dni) > 0))
   return 1;



This should hopefully accept 9-digit numbers only, or a blank field if a country is selected that doesn't require a number.

Link to comment
Share on other sites

  • 1 month later...

Edit classes/Tools.php and uncomment line 406 (in PrestaShop v1.3.2):

//if ($string == 'Fatal error') d(debug_backtrace());



That should display a stack trace that will help you find the code that is throwing the error and comment it out so that the check isn't performed.

Link to comment
Share on other sites

  • 2 months later...
It's because PrestaShop is programmed to only accept Spanish DNI / NIF / NIE numbers by default.

Try changing line 769 of classes/Validate.php from:

if (!$dni)
   return 1;



to:

if (!$dni OR ($dni AND strlen($dni) == 9 AND intval($dni) > 0))
   return 1;



This should hopefully accept 9-digit numbers only, or a blank field if a country is selected that doesn't require a number.



This modification dont work for me, presta 1.3.6
If I change 9 for blank general error occurs.
If I change 9 for 13, error...

How I can use the DNI/NIF option to countries with other ID card formats? or How I can disable the DNI/NIF verification?
Thanks.
Link to comment
Share on other sites

Hello, I have a problem related to the topic again. Initially everything was resolved because only made sales to Portugal, where the NIF has 9 digits.

Now I make sales to Brazil and I need the CPF of the country that has 13 digits.

There is the possibility to withdraw the option of 9 digits and place to meet people without being required to put X number?

Portugal and Brazil will have 9 digits 13.
I think the best way would be to allow any amount of numbers, how should I precede?

Link to comment
Share on other sites

  • 3 weeks later...


This modification dont work for me, presta 1.3.6
If I change 9 for blank general error occurs.
If I change 9 for 13, error...

How I can use the DNI/NIF option to countries with other ID card formats? or How I can disable the DNI/NIF verification?
Thanks.


You can disable it by country, in the admin.
For each country you can specify if it's needed or not.
  • Like 1
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...