diogobguerreiro Posted September 23, 2010 Share Posted September 23, 2010 Hello,I just installed my shop and now I walk in settings. Turns out to record the first customer test gives the following error DNI / NIF / NIE is not validI have to make any changes to work? The field DNI / NIF / NIE will have to be able to receive always 9 digits.Link to store test: http://loja.fotografia-dg.com/Thanks Link to comment Share on other sites More sharing options...
rocky Posted September 24, 2010 Share Posted September 24, 2010 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 More sharing options...
diogobguerreiro Posted September 24, 2010 Author Share Posted September 24, 2010 It worked!Thank you. Link to comment Share on other sites More sharing options...
rocky Posted September 24, 2010 Share Posted September 24, 2010 Great. Please edit your first post and add [sOLVED] to the front of the title. Link to comment Share on other sites More sharing options...
Stefand Posted November 22, 2010 Share Posted November 22, 2010 I have a problem, I have change this..But now I get this error when I edit customer info :Fatal error (Customer -> dni = 0830564676)And also into the admin when I would change the customer info:the field dni is invalid Link to comment Share on other sites More sharing options...
rocky Posted November 27, 2010 Share Posted November 27, 2010 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 More sharing options...
Stefand Posted November 27, 2010 Share Posted November 27, 2010 Rocky,I have buy the tax module from dutchcoding, so my problem is solved. Link to comment Share on other sites More sharing options...
Caspian Posted February 8, 2011 Share Posted February 8, 2011 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.6If 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 More sharing options...
diogobguerreiro Posted February 9, 2011 Author Share Posted February 9, 2011 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 More sharing options...
msk69 Posted February 26, 2011 Share Posted February 26, 2011 This modification dont work for me, presta 1.3.6If 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. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now