Background

After the recent update of WC - APG NIF/CIF/NIE Field to version 3.0, in which we have added support for the Checkout block of the WordPress block editor, and as we announced in WC - APG NIF/CIF/NIE Field now supports the Checkout block, we have taken the opportunity to remove some overly intrusive code that was causing compatibility problems with third-party plugins and an option from the settings form that was no longer necessary.

What that code did was add the NIF/CIF/NIE field, the telephone and the email address to the address shown on orders, but given that this affects the addresses shown on the Thank you and My account pages, on orders and in the emails WooCommerce sends.

To avoid having to override the native email templates so that the telephone and the email address were not shown twice, and given that we knew we were causing problems in other plugins, we have decided to add only the NIF/CIF/NIE field to the addresses and remove the other two fields.

So far so good, but it now turns out that those of you who have been using the plugin for years are now used to seeing that data in the order addresses and you miss it, so we have rolled up our sleeves and created a small piece of PHP code for you that is going to solve the problem without affecting the rest of the ecosystem.

Solution

The solution involves adding the following PHP code to your child theme’s functions.php file or to the custom plugin you have for adding this kind of code:

Copy to clipboard

Thanks to this small piece of code it is going to add the two fields to all the local address formats that WooCommerce has, after the country field, and it will do so exclusively in the administration panel, specifically in the order listings and when editing them; it will not affect the emails WooCommerce sends, nor the Thank you or My account pages.

In this way you will once again have WooCommerce’s native address with our NIF/CIF/NIE field, the telephone and the email address. In fact, if you need to add any other field you only have to customise this code and add it so as to leave the address just as you like it.

We hope you find this code useful in your projects and we look forward to your comments.

Related posts

Comments

Suscríbete
Notificar de
0 Comments
Más antiguos
Más recientes Más votados

In this post

Products and services

Latest posts

Latest comments

Subscribe!

Lista de correos de APG

DATA PROTECTION: In accordance with data protection regulations, we provide you with the following processing information: (+)

  • Responsible: Art Project Group.
  • Treatment purposes: to respond to queries or any type of request made by the user through any of the forms of contact that are made available on the website. Sending communications about products or services (with your consent).
  • Your rights: access, rectification, portability, deletion, limitation and opposition. More information about the treatment in the Privacy Policy.

What we post on !

Se ha publicado #WooCommerce 11.2.2: actualización de seguridad que refuerza las API REST y Store, mejora la validación de CSV y corrige problemas en pagos y pedidos. Incluye cambios en la base de datos.

¡Actualiza cuanto antes!

13 hours ago