v1.2.1 · updated on 10/20/2026
Validated with the official PrestaShop validator
Spanish DNI, NIE and CIF validation module for PrestaShop
Free PrestaShop DNI validation module.
Warns customers, while they fill in their address, when their DNI, NIE, CIF or Portuguese NIF is not valid. Prevents invoices with a mistyped number without ever blocking the order.
- PS 1.7
- PS 8
- PS 9
- Instant download from My modules
- Updates from your account
Developed and maintained by Kebes, a PrestaShop Expert level 3 agency with more than 15 years developing for PrestaShop.
This module brings DNI validation to PrestaShop, and also checks the NIE, the CIF and the Portuguese NIF right as the customer types it. It is free and compatible with PrestaShop 1.7.8, 8 and 9.
The problem: invoices with a mistyped ID number
PrestaShop accepts anything in the identification number field. One wrong letter or a missing digit and the invoice is wrong, and the customer asks for a new one weeks later. The module checks the control letter or digit and warns right away so it can be fixed.
It never blocks. If the customer has a foreign document or wants to go on anyway, they can still buy: they just confirm it with a checkbox in the payment step.
Which documents it validates
- Spain: DNI, NIE, K/L/M NIF and company CIF.
- Portugal: NIF.
- Other countries: nothing is checked.
Features
- Live warning under the field: shown when leaving the field and removed once fixed, on both delivery and invoice addresses.
- Confirmation checkbox at payment: if the address is saved with a wrong number, the customer confirms they have checked it before paying.
- Order note for invoicing: if the number is not valid, the order gets a private note (back office only) to check it before issuing the invoice.
- Clean number: a valid number is stored without spaces, dots or dashes (12.345.678-z becomes 12345678Z), and old 7-digit DNIs get their leading zero.
- One page checkout: works with the official ps_onepagecheckout module (field warning only).
- No overrides, no settings: install it and it works. It does not touch the core or clash with other modules.
- Classic and Hummingbird themes: the warning uses the theme styles.
Compatibility
Compatible with PrestaShop 1.7.8, 8 and 9. Tested on PrestaShop 1.7.8.11, 8.2.7, 9.1.4 and 9.2.0 (also with ps_onepagecheckout), with PHP 7.4, 8.3 and 8.4.
Installation
Download the zip and upload it in Modules › Module Manager › Upload a module. There is nothing to configure: from then on it validates addresses in Spain and Portugal.
FAQ
Does it block the order if the DNI is not valid?
No. It warns under the field and, if the customer goes on, asks them to confirm with a checkbox before paying. It never prevents saving the address or placing the order.
What about a foreign customer with an address in Spain?
If they type their NIE, it is validated like any other. If they type a passport number, they see the warning and can still buy by ticking the checkbox.
Does it make the DNI field required?
No. Whether the identification number is required is set per country (International › Locations › Countries).
Does it validate addresses created in the back office?
No, only the ones customers create in the shop.
Does it check the NIF with the Spanish tax agency?
No. It checks that the control letter or digit matches, which is what catches typing mistakes; it does not query the tax agency.
More free modules for your shop in the veomod.com catalogue.
Changelog
1.2.1 – 2026-10-20
- `.htaccess` in the module folder that stops its PHP files from being opened directly.
- Code reviewed with the official PrestaShop validator (formatting, headers and good practices). No change in how it works.
1.2.0 – 2026-10-18
New: private order note when the ID number is not valid, to check it before issuing the invoice.
Fixed: with ps_onepagecheckout installed but disabled, the payment checkbox did not show in the PrestaShop checkout.
1.1.1 – 2026-10-17
Improved: compatible with PrestaShop 9.2.0, also with the ps_onepagecheckout one page checkout.
Fixed: with ps_onepagecheckout and a customer with a saved address, the warning could end up next to a hidden field.
1.1.0 – 2026-10-17
Important: it no longer blocks the address or the order, it only warns. Requires PrestaShop 1.7.8 or later.
New: warning under the field while the customer types.
New: checkbox at payment to confirm the number if the address is saved with a wrong one.
New: compatible with ps_onepagecheckout.
New: a valid number is stored clean, without spaces, dots or dashes.
Improved: only validates addresses in Spain (DNI, NIE, CIF) and Portugal (NIF).
Improved: no overrides, no clashes with other modules.
Fixed: the Portuguese NIF was always rejected.
1.0.0 – 2025-06-06
New: module release.
Compatibility
| PrestaShop | Module version | Status |
|---|---|---|
| 1.7.8 – 9.2 | 1.2.1 | Compatible |
| 1.7.7 and older | — | Not compatible |
Data sheet
- Versión
- 1.2.1
- Languages
- English, Spanish
- Support languages
- English, Spanish
Will it work in your shop? Ask us before buying
If you need a specific feature, or your PrestaShop version is not listed as tested, tell us. It often works all the same. And if you ask for a feature that improves the module and can help more shops, we add it in a next version at no cost to you. The person who wrote the module answers you.