WC – APG Campo NIF/CIF/NIE

Descripción

WC – APG Campo NIF/CIF/NIE adds to your WooCommerce store a new NIF/CIF/NIE field in all billing and shipping forms, available to both the administrator and the customer.

Requirements: the plugin needs WooCommerce 2.4.0 or higher and the SoapClient PHP class for VIES/EORI validation.

Características

  • Fully compatible with the Checkout block of the WordPress block editor.
  • You can require the NIF/CIF/NIE field in the billing form.
  • You can require the NIF/CIF/NIE field in the shipping form.
  • You can hide the NIF/CIF/NIE field from the shipping form.
  • You can customize the priority (position) of the field.
  • Puedes validar el campo NIF/CIF/NIE.
  • You can validate the VIES VAT number field to apply a tax exemption.
  • You can validate the EORI field to prevent the sale if a valid number is not entered.
  • You can select the country(ies) where the EORI field will be validated.
  • You can customize the label and placeholder of the NIF/CIF/NIE, VIES VAT number or EORI field.
  • You can customize the error message of the field NIF/CIF/NIE, VIES VAT number or EORI.
  • You can customize the error message if the maximum number of requests to the VIES VAT number verification API is exceeded.
  • Add and require phone and email fields in the shipping form.
  • You can remove the phone and email fields from the default address.
  • You can display and customize an error message for the billing form using the apg_nif_display_error_message and apg_nif_error_message filters.
  • You can remove the Email and Phone fields from the submission form with the apg_nif_add_fields filter.
  • You can skip validation by country or external condition with the apg_nif_skip_validation filter.
  • You can override the required status for billing or shipping with the apg_nif_skip_required filter.
  • Adds a customer download button in WooCommerce (Customers) that includes the NIF/CIF/NIE field in the CSV.
  • It validates documents from:
    • Albania.
    • Andorra.
    • Austria.
    • Argentina.
    • Åland Islands.
    • Belgium.
    • Bulgaria.
    • Belarus.
    • Switzerland.
    • Chile.
    • Cyprus.
    • Czech Republic.
    • Germany.
    • Denmark.
    • Estonia.
    • Spain.
    • European Union.
    • Finland.
    • Faroe Islands.
    • France.
    • Great Britain.
    • Greece.
    • Croatia.
    • Hungary.
    • Ireland.
    • Iceland.
    • Italy.
    • Liechtenstein.
    • Lithuania.
    • Luxembourg.
    • Latvia.
    • Monaco.
    • Moldova.
    • Montenegro.
    • North Macedonia.
    • Malta.
    • Netherlands.
    • Norway.
    • Poland.
    • Portugal.
    • Romania.
    • Serbia.
    • Sweden.
    • Slovenia.
    • Slovak Republic.
    • San Marino.
    • Ukraine.
  • 100% compatible con WooCommerce PDF Invoices & Packing Slips.
  • 100% compatible con WPML.
  • 100% compatible with Checkout Field Editor (Checkout Manager) for WooCommerce

Traducciones

Más información

You can learn more about WC – APG Campo NIF/CIF/NIE on our official website, and follow the development on GitHub.

Agradecimientos

Thanks to everyone who uses the plugin, helps improve it, makes a donation or encourages us with their comments.

If you find this plugin useful, you can support its development with a small donation.

External Services

  1. To the WordPress.org Plugins API to fetch plugin information.

    • It sends the plugin slug when requesting data.
    • More information: https://wordpress.org/about/privacy/
  2. To the European Commission VAT number validation API (VIES) and EORI number validation API.

    • It sends the country and VAT number — VIES validation —.
    • It sends the EORI number.
    • More information: https://commission.europa.eu/privacy-policy-websites-managed-european-commission_es
  3. To the UK Government EORI number validation API.

    • It sends the EORI number.
    • More information: https://www.gov.uk/help/privacy-notice
  4. To the VatApp EORI number validation API.

    • It sends the EORI number.
    • More information: https://vatapp.net/privacy-policy

Capturas

Instalación

  1. Install the plugin in one of the following ways:
    • Upload the wc-apg-nifcifnie-field folder to the /wp-content/plugins/ directory via FTP.
    • Upload the full ZIP file via Plugins -> Add New -> Upload in the WordPress administration panel.
    • Search for WC – APG Campo NIF/CIF/NIE in Plugins -> Add New and click Install Now.
  2. Activate the plugin through the Plugins menu in the WordPress administration panel.
  3. Configure the plugin in WooCommerce -> NIF/CIF/NIE field or through the Settings link on the plugins page.

FAQ

How do I configure the plugin?

The plugin settings are very simple: you only need to indicate whether you want the NIF/CIF/NIE field to be validated or not, and configure the optional VIES and EORI validation if you need them.

How do I fix duplicate NIF metadata from older orders?

If your store placed orders via the Checkout block (or the classic checkout) with an older version of the plugin, some orders may have duplicate or legacy billing_nif / shipping_nif metadata rows that prevent the field from updating correctly in the admin panel.

Option 1 – Settings page (recommended): Go to WooCommerce -> NIF/CIF/NIE field. If duplicates are detected, a “Fix duplicate NIF metadata” button appears at the bottom of the page. Click it to run the cleanup. The button disappears automatically once there are no more duplicates.

Option 2 – WP-CLI (large stores): Run the following command from the root of your WordPress installation to avoid HTTP timeouts:

wp eval-file wp-content/plugins/wc-apg-nifcifnie-field/includes/admin/limpieza-meta-duplicados.php

Where can I get support?

WC – APG Campo NIF/CIF/NIE is a free plugin. Art Project Group does not provide free technical support, but offers a paid technical support service for installation and configuration.

Reseñas

29 de mayo de 2025 1 respuesta
Un desarrollador excepcional y comprometido No suelo dejar reseñas, pero en este caso es más que merecida. El trabajo que hay detrás de este plugin es impresionante: funcional, estable y siempre actualizado. Se nota el cuidado, la atención al detalle y, sobre todo, la pasión por ofrecer una herramienta útil y bien construida. Además, la rapidez con la que se responden dudas o se solucionan problemas es digna de admiración. No solo es un gran desarrollador, sino también alguien que valora a su comunidad de usuarios. Agradezco profundamente el esfuerzo constante que pone en este proyecto. ¡Mi reconocimiento y apoyo total!
18 de diciembre de 2024
Tuve un problema al instalar el plugin, les pasé el código del error y en un par de horas ya tenía la solución y el error quedó arreglado.
18 de septiembre de 2024
El plugin hace lo que se le pide a la perfección y funciona genial con Woocommerce.A destacar la rapidez del servicio técnico en un problema puntual que tuvimos con el plugin, y que resolvieron en minutos sacando una nueva actualización del plugin. 10 de 10!
Leer todas las 23 reseñas

Colaboradores y desarrolladores

«WC – APG Campo NIF/CIF/NIE» es un software de código abierto. Las siguientes personas han colaborado con este plugin.

Colaboradores

«WC – APG Campo NIF/CIF/NIE» ha sido traducido a 4 idiomas locales. Gracias a los traductores por sus contribuciones.

Traduce «WC – APG Campo NIF/CIF/NIE» a tu idioma.

¿Interesado en el desarrollo?

Revisa el código , echa un vistazo al repositorio SVN o suscríbete al registro de desarrollo por RSS.

Registro de cambios

4.14.1

  • Fixed: the metadata cleanup and the one-time automatic migration did not actually process the HPOS order table (wc_orders_meta); they relied on the $wpdb->wc_orders_meta property, which WooCommerce does not set, so on HPOS stores the 4.14.0 migration touched only postmeta and left the orders untouched. The HPOS table is now detected from the database prefix, and the automatic one-time cleanup runs again on update to 4.14.1 to migrate those orders to _billing_nif / _shipping_nif.

4.14.0

  • The order meta key for the NIF/CIF/NIE is now _billing_nif / _shipping_nif (with a leading underscore), matching WooCommerce’s native order meta convention (_billing_*) so the value is read by ERP integrations such as Holded and others that expect the underscored key. Reading still falls back to the legacy billing_nif / shipping_nif for orders placed with previous versions.
  • The duplicate-metadata cleanup tool now migrates the legacy billing_nif / shipping_nif keys to the canonical _billing_nif / _shipping_nif (in both postmeta and HPOS wc_orders_meta). Run it from the plugin settings or via WP-CLI on large stores.
  • This cleanup also runs automatically once, in the admin, right after updating to this version, so the migration happens without clicking the button (the settings button and the WP-CLI script remain available as an alternative for very large stores).
  • Customer (user) meta is unchanged: it stays billing_nif / shipping_nif, as WooCommerce stores customer billing fields without the underscore.

4.13.0

  • Fixed the NIF/CIF/NIE field not being auto-filled when selecting a customer while creating or editing an order in the admin panel. The field is now rendered with the id that WooCommerce’s customer-details script expects (_billing_nif / _shipping_nif), while the value is still stored under the canonical billing_nif / shipping_nif keys.
  • Unified the NIF metadata key across every save path. The classic checkout no longer leaves a legacy _billing_nif / _shipping_nif copy, and editing an order from the admin panel no longer creates a second metadata entry.
  • Rewrote the duplicate NIF metadata detection and cleanup tool. Detection now also finds orders where billing_nif and _billing_nif (or shipping_nif and _shipping_nif) coexist, works on both postmeta and wc_orders_meta (HPOS, including sync mode and configurations where the cleanup button previously failed to appear), and caches the query for one hour to avoid performance issues on large stores. The cleanup migrates lone legacy keys to the canonical key, removes legacy keys when the canonical one already exists, and deduplicates repeated rows, so detection and cleanup always agree (fixing the case where the button appeared but reported “0 fixed”).
  • Reviewed and corrected the plugin’s English texts. Fixed the wording of the settings description and field tooltips (e.g. “validate the field before submission”, “allow and validate the VIES VAT number / the EORI number”) and of the information box (“Contact us”, “If you enjoy this plugin and find it helpful”), and renamed the “End Purchase block” reference to the correct WooCommerce term “Checkout block”.

4.12.2

  • Fixed the root cause of the NIF field not saving when editing an existing order from the admin panel: the field definition was missing an explicit id, so WooCommerce was writing the admin-entered value to _billing_nif / _shipping_nif instead of billing_nif / shipping_nif. As a result, the display always showed the original checkout value unchanged.
  • Fixed the duplicate NIF metadata detection function so it checks both postmeta and wc_orders_meta (HPOS) regardless of the active storage mode. Previously the cleanup button could fail to appear on stores using HPOS sync mode or certain HPOS configurations.

4.12.1

  • Fixed a regression introduced in 4.12.0 where editing the NIF field on an existing order from the admin panel and saving would silently discard the new value, leaving the old one in the database. This happened on stores with duplicate NIF metadata rows created by older versions of the plugin. The automatic deduplication hook has been removed; use the cleanup button in the plugin settings or the WP-CLI script instead.

4.12.0

  • Fixed duplicate billing_nif / shipping_nif metadata rows generated when placing orders with Checkout Blocks, which caused the NIF field to appear unchanged after editing an order from the admin panel.
  • Added a “Fix duplicate NIF metadata” button in the plugin settings page to clean up existing duplicate rows in stores affected by previous versions.

4.11.4

  • Fixed a Checkout Blocks regression introduced in 4.11.3 where the NIF/CIF/NIE field could be treated as a native address field during Store API requests and incorrectly trigger a required-field error on checkout.

4.11.3

  • Fixed the NIF/CIF/NIE field in My Account address editing when the account page is rendered with the [woocommerce_my_account] shortcode on stores using Checkout Blocks.

4.11.2

  • Fixed order admin and formatted address NIF loading for orders created with Checkout Blocks by reading billing_nif and shipping_nif first, with fallback to legacy meta keys.

4.11.1

  • Fixed requerido_envio in classic checkout so the shipping NIF/CIF/NIE field is only required when the customer checks “Ship to a different address”.

4.11.0

  • Added the apg_nif_skip_required filter to override the required status for billing or shipping via hook.

4.10.0

  • Added support for Italian Codice Fiscale validation.
  • Fixed international prefix detection so non-ISO leading letters are not treated as country prefixes.
  • Fixed Checkout Block VIES validation initialization in valida-bloques-nif.js.

4.9.1

  • Fixed compatibility with FunnelKit Builder custom checkout validation when showing the shipping field.
  • Arreglos menores.

4.9.0

  • Added compatibility declaration for product_instance_caching.
  • Improved VIES, EORI and VAT exemption handling.

4.8.3

  • Added a new option to hide the shipping NIF/CIF/NIE field.
  • Improved required billing/shipping field handling in the Checkout Block.
  • Fixed compatibility with Checkout Field Editor (Checkout Manager) for WooCommerce.
  • Arreglos menores.

4.8.2

  • Arreglos menores.

4.8.1

  • Added the apg_nif_skip_validation filter
  • Arreglos menores.

4.8.0

  • Fixed JavaScript validation.

4.7.0.6

  • Arreglos menores.

4.7.0.5

  • Arreglos menores.

4.7.0.4

  • Arreglos menores.

4.7.0.3

  • Arreglos menores.

4.7.0.2

  • Arreglos menores.

4.7.0.1

  • Arreglos menores.

4.7

  • Addition of a customer download button in WooCommerce (Customers) that includes the NIF/CIF/NIE field in the CSV.
  • Arreglos menores.

4.6.0.1

  • Arreglos menores.

4.6

  • Addition of document validation for new countries.
  • Arreglos menores.

4.5.0.2

  • Arreglos menores.

4.5.0.1

  • Arreglos menores.

4.5

  • Added PHPDoc blocks throughout the code.
  • Fixed compatibility with Checkout Field Editor (Checkout Manager) for WooCommerce.
  • Arreglos menores.

4.4.0.1

  • Arreglos menores.

4.4

  • Fixed tax exemption handling.
  • Arreglos menores.

4.3

  • Fixed required field handling in the addresses on the My Account page.
  • Arreglos menores.

4.2

  • Fixed JavaScript validation.
  • Arreglos menores.

4.1.0.1

  • Correction and unification of user metas.

4.1

  • Added shipping country check to the tax exemption.
  • Arreglos menores.

4.0.0.9

  • Arreglos menores.

4.0.0.8

  • Arreglos menores.

4.0.0.7

  • Arreglos menores.

4.0.0.6

  • Added the NIF field to the Checkout block address.

4.0.0.5

  • Arreglos menores.

4.0.0.4

  • Added live validation.
  • Improved security.
  • Arreglos menores.

4.0.0.3

  • Arreglos menores.

4.0.0.2

  • Arreglos menores.

4.0.0.1

  • Arreglos menores.

4.0

  • Full compatibility added for VIES and EORI validation in the Checkout Block.
  • General performance improvements.
  • Full code compliance with WordPress security standards.
  • Addition of document validation for new countries.
  • Arreglos menores.

3.2.0.1

  • Pequeños arreglos.

3.2

  • Added apg_nif_add_fields filter.
  • Improved validation.

3.1.0.2

  • Pequeños arreglos.

3.1.0.1

  • Pequeños arreglos.

3.1

  • Improved security.
  • Improved international validation process.
  • Pequeños arreglos.

3.0.15

  • Pequeños arreglos.

3.0.14

  • Pequeños arreglos.

3.0.13

  • Pequeños arreglos.

3.0.12

  • Pequeños arreglos.

3.0.11

  • Pequeños arreglos.

3.0.10

  • Limits features to the Checkout Block.

3.0.9

  • Pequeños arreglos.

3.0.8

  • Pequeños arreglos.

3.0.7

  • Pequeños arreglos.

3.0.6

  • Pequeños arreglos.

3.0.5

  • Pequeños arreglos.

3.0.4

  • Improved compatibility with third party plugins.

3.0.3

  • Improved compatibility with third party plugins.

3.0.2

  • Pequeños arreglos.

3.0.1

  • Fixed a bug affecting versions below WooCommerce 8.9.

3.0

  • Added support for the Checkout block.
  • Improved compatibility with third party plugins.

2.1.0.2

  • Pequeños arreglos.

2.1.0.1

  • Pequeños arreglos.

2.1

  • Added HPOS support.

2.0.1

  • Pequeños arreglos.

2.0

  • Added EORI number validation option Upgrade sponsored by OldWood – Ground, Oil Varnishes & Natural Colours.
  • Added option to select priority of the field NIF/CIF/NIE.
  • Added two filters to display and customize an error message for the billing form: apg_nif_display_error_message and apg_nif_error_message.
  • Actualización de captura de pantalla.

1.7.4.1

  • Actualización de cabecera.
  • Actualización de hoja de estilo.
  • Actualización de captura de pantalla.

1.7.4

  • Validates the shipping form only if it has been activated.
  • Validates VIES number only for supported countries.

1.7.3.1

  • Indicates the corresponding form in the field validation.

1.7.3

  • Add the NIF/CIF/NIE field in the order search.

1.7.2.6

  • Pequeños arreglos.

1.7.2.5

  • Pequeños arreglos.

1.7.2.4

  • Pequeños arreglos.

1.7.2.3

  • Added support for Polylang.

1.7.2.2

  • Pequeños arreglos.

1.7.2.1

  • Pequeños arreglos.

1.7.2

  • VIES validation fix for Greece and Ireland.

1.7.1

  • Adjustment to make the new option compatible with WooCommerce PDF Invoices & Packing Slips.

1.7

  • Now you can now remove the phone and email fields from the default address.

1.6

  • Customizable error messages and translatable with WPML.
  • Pequeños arreglos.

1.5.1

  • Added tax exemption on shipping costs.

1.5

  • Eliminada la exención de impuestos sobre los costos de envío.
  • Añadidos los campos de teléfono y correo electrónico en las direcciones internacionales.
  • Pequeños arreglos.

1.4.2

  • Eliminado el teléfono y la dirección de correo electrónico duplicados en la página de agradecimiento.

1.4.1

  • Nombre de campo de texto traducible con WPML.

1.4.0.2

  • Actualización de la plantilla de cuentas de correo electrónico.
  • Pequeños arreglos.

1.4.0.1

  • Pequeños arreglos.

1.4

  • Añadida personalización de la etiqueta y marcador de posición del campo.
  • Actualización de captura de pantalla.

1.3.0.2

  • Pequeños arreglos.
  • Quitados todos los cambios del orden de campos.

1.3.0.1

  • Pequeños arreglos.

1.3

  • Añadidos los campos en WooCommerce PDF Invoices & Packing Slips para facturas con direcciones fuera de España.

1.2.1.3

  • Pequeños arreglos.

1.2.1.2

  • Añadido mensaje de error y desactivación cuando la clase PHP SoapClient no existe.

1.2.1.1

  • Añadida compatibilidad con WooCommerce 3.4.

1.2.1

  • Pequeños arreglos.

1.2.0.4

  • Eliminación de doble teléfono y dirección de correo electrónico en el correo electrónico de pedido.
  • Arreglo de la validación del número CIF.

1.2.0.3

  • Eliminación de doble teléfono y dirección de correo electrónico en el correo electrónico de pedido.

1.2.0.2

  • Actualización de cabecera.
  • Actualización de hoja de estilo.
  • Actualización de captura de pantalla.

1.2.0.1

  • Arreglo de la validación del número CIF.

1.2

  • Evita la validación del campo NIF/CIF/NIE fuera de España.
  • Arreglos menores.

1.1.0.6

  • Mostrar el campo de correo electrónico en los pedidos creados manualmente en WooCommerce 3.x.
  • Impedir la validación del NIF/CIF/NIE con la validación del número VIES seleccionada.

1.1.0.5

  • Nombre de campo de texto traducible.

1.1.0.4

  • Mejora del rendimiento.

1.1.0.3

  • Arreglo de localización.

1.1.0.2

  • Mejora de la validación del número VIES.

1.1.0.1

  • Internacionalización de la validación del número VIES.

1.1

  • Añadida opción de validación del número VIES.

1.0.1.3

  • Ajuste para optimizar la compatibilidad con WooCommerce 3.0.

1.0.1.2

  • Soporte para instalaciones multisitio.

1.0.1.1

  • Muestra todos los campos en los clientes no registrados.

1.0.1

  • Arreglo del formato de direcciones en los correos electrónicos.
  • Arreglo de traducciones faltantes en español.

1.0

  • Muestra el campo correo en los pedidos creados manualmente.
  • Muestra el correo electrónico en los datos de cliente.
  • Eliminadas todas las clases personalizadas de los campos para mejorar la compatibilidad universal con las plantillas.
  • Estructura interna del plugin totalmente reescrita para facilitar su mantenimiento.

0.3

  • Carga del valor del campo NIF/CIF/NIE en los pedidos creados manualmente.

0.2

  • Añadidas nuevas opciones de configuración.
  • Actualización de traducción.
  • Actualización de captura de pantalla.

0.1

  • Versión inicial.