Jump to content

dni number not being saved in database


Recommended Posts

Hello,

 

after some issues with company-vat_number-and dni fields in registration

(not showing during the first registration process, after the registration is being done they show during applying changes to the address)

 

but the DNI - identification number is not being saved in the DB

 

UPDATE: If a country is set to  - need_identification_number - identification number will be stored in the DB

If a country is set to not mandatory dni - it will not be stored

 

It should be not difficult to tell Prestashop: save and get dni although not having been set as required for the country.

 

Maybe could someone help me to speed up my search - without your help I have to test everything through trial/error-method.

 

Thank you!

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

  • 1 month later...

Hello,

 

after some issues with company-vat_number-and dni fields in registration

(not showing during the first registration process, after the registration is being done they show during applying changes to the address)

 

but the DNI - identification number is not being saved in the DB

 

UPDATE: If a country is set to  - need_identification_number - identification number will be stored in the DB

If a country is set to not mandatory dni - it will not be stored

 

It should be not difficult to tell Prestashop: save and get dni although not having been set as required for the country.

 

Maybe could someone help me to speed up my search - without your help I have to test everything through trial/error-method.

 

Thank you!

Hi, I had same problem, my solution was edit controllers/front/AddressController.php file.

From:

                        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.');

                        else if (!$country->isNeedDni())

                                $address->dni = null;

 

To :

                        if (Tools::getValue('dni') && !Validate::isDniLite(Tools::getValue('dni')))

                                $this->errors[] = Tools::displayError('The identification number is incorrect or has already been used.');

 

The validation for dni does not work, but the storage dni to dabase yes.

  • Like 4
Link to comment
Share on other sites

×
×
  • Create New...