A few weeks ago a client wrote to us because their accountant was sending back half a dozen orders a month with no tax number on them, and when we looked at their shop we found they had been running WC - APG NIF/CIF/NIE Field for two years on the settings it ships with.
At APG we took the chance to walk through the whole screen, field by field, because it has grown quite a lot since that first 2013 release and there are settings that solve in two clicks what many people end up asking us to build for them.
Everything lives in WooCommerce -> NIF/CIF/NIE field, and the sections are in the order you want to work through them.
The field
This is the first thing your customer sees, and the only thing they will see if you change nothing else.
The Field label is the name shown above the field and the Field placeholder is the hint inside it while it is empty, with NIF/CIF/NIE and NIF/CIF/NIE number as the defaults you get back by leaving the box blank.
The Error message is what the buyer reads when the number does not pass, and it is worth replacing the terse “Please enter a valid NIF/CIF/NIE.” that comes preset with something that tells them what to do about it.
The Field priority decides where the field sits in the form, and the lower the number the higher it goes.
It is 31 out of the box, which puts it right after the company name, and underneath the setting you get the list of priorities the other fields of your shop are using right now, so there is no guesswork: pick a number that falls between the two fields you want it to sit between and you are done.
When the customer is asked for it
Billing and shipping are configured separately, and that is what makes this section useful.
Require billing field? stops the order from going through without a number on the billing form, which is what solved our client’s problem.
But there is a finer option, Require billing field from this amount, which makes the field required only from the amount you type in, taxes included, even when the box above is unticked.
It is the one we recommend to shops that sell to consumers and to companies alike, because asking for a tax number from someone buying a nine-euro spare part is the quickest way to lose that sale, whereas on a thousand-euro order nobody blinks.
Leave it empty to switch it off, and bear in mind that it never affects the shipping form.
Show shipping field? adds the field to the shipping form as well, and Require shipping field? makes it mandatory there, which only has an effect if you have shown it first.
Validation
The Validate field? box is what separates a plain text field from one that actually does something.
With it ticked the plugin checks that the number is a real NIF, CIF or NIE, control letter included, and stops the order with the error message you wrote if it is not.
And it does not stop at Spain: every identifier is checked with the official algorithm of its own country, from Albania to Uruguay by way of all twenty-seven of the European Union, so a Portuguese customer with a Portuguese tax number gets through and one with nine made-up digits does not.
Untick it and the plugin simply stores whatever the customer types, which is what you want if you sell to countries whose documents are not on the list.
The VIES VAT number
This is where the plugin stops being a field and becomes a tax tool.
Tick Allow VIES VAT number? and customers from the rest of the European Union can enter their intra-community VAT number, which is checked live against the European Commission’s VIES register so the order comes out exempt from tax.
It needs PHP’s SoapClient class and, if your hosting does not have it, the plugin warns you and keeps the option off rather than failing silently.
The first two settings in the section, VIES VAT number field label and VIES VAT number field placeholder, replace the label and the placeholder from the first section as soon as you switch VIES on, and they do so for every customer, not only for the foreign ones.
The VIES VAT number error message is what customers read when VIES answers that the number does not exist.
And the VIES VAT number request error message deserves a paragraph of its own, because it is the message shown when VIES cannot answer owing to too many requests in a short time, and that does not mean the number is wrong: it means the register is asking you to wait, so the wording should invite the customer to try again rather than to correct anything.
If your shop makes a lot of consecutive requests, the apg_nif_maximo_consultas_por_minuto filter lets you cap how many a single IP can trigger per minute, and it ships switched off.
The EORI number
EORI is the number customs uses to identify a business that imports or exports, so this section mostly matters to shops selling to companies outside the European Union.
Allow EORI number? switches it on, and Countries to validate EORI number is where you pick whose customers will be asked for it, with a search box that saves you scrolling the whole list.
Leave the list empty and nobody is asked for it.
Its three text settings work just like the VIES ones, with one quirk worth knowing: when you have VIES and EORI switched on at the same time, the label that wins is the EORI one.
Downloading your customers with their tax number
This one is not on the settings screen, which is why hardly anyone knows it is there.
The plugin adds a download button to WooCommerce -> Customers that produces a CSV with the NIF/CIF/NIE field included, which is exactly the file your accountant asks you for every quarter.
The help inside the plugin
You do not need to remember any of this, because the settings screen explains it: click Help, top right, and you get a panel for each section with all of its settings.
And if you want the full detail, with screenshots and frequently asked questions, it is in its complete documentation, which is where the link in the sidebar of that same tab takes you.
Conclusion
Thanks to these settings you stop chasing the tax numbers that never arrived, your accountant gets complete orders and your intra-community customers buy tax free without you touching a thing.
If we had to keep two of them, they would be validation and the minimum amount: the first saves you from made-up numbers and the second from the small sales that fall apart at the last step.
We hope you find it useful, and we look forward to your comments.
Help
We would also like to remind you that WC - APG NIF/CIF/NIE Field is a completely free WooCommerce plugin, so if you want to help APG keep it free, you can make a donation towards its improvement and upkeep.
Related posts
Comments








