Asking business customers for a VAT number without bothering everyone else
When a store sells to consumers and businesses, the sign-up form has to work for both. Magento's own fields are all or nothing; here is how to make them depend on the answer.
Say you sell office furniture to companies and, now and then, to someone kitting out a spare room. The companies need a VAT number on their invoices and you would like to know what kind of business they are. The person with the spare room should not have to scroll past a VAT number field, wonder whether they need one, and give up.
It sounds like a small problem, but every field that does not apply to someone is one more chance for them to stop. This post is about asking each customer only what applies to them, and keeping the answers where your team will find them.
What Magento already has
Before reaching for an extension, check the fields Magento ships with. Under Stores > Configuration > Customers > Customer Configuration you can switch on several optional account and address fields, including "Show Tax/VAT Number" for the account and "Show Company" for addresses, each as No, Optional or Required. There is also "Show VAT Number on Storefront" for the VAT number in customer addresses1.
If every customer is a business, or a VAT number is optional for everyone and that is fine, those settings may be all you need, and you should use them. Their limit is that each one applies to the whole website: a field is shown to everyone or nobody, and is required from everyone or nobody. There is no way to show it only to people who said they are a business.
Adding fields of your own is the next limit. Adobe Commerce, the paid edition, has screens for customer and customer address attributes under Stores > Attributes; Adobe's documentation describes customer address attributes as available only in Adobe Commerce, not in Magento Open Source2. On Open Source, a new customer field means code.
Fields that depend on an earlier answer
The pattern that fixes the furniture example is a field that appears only when another answer makes it relevant. Ask "Company type" first, with options such as Private customer, Sole trader, Limited company, Partnership and Charity. Show "VAT number" only when the answer is one of the business types. A private customer sees one question, picks "Private customer" and moves on.

Two details make this work in practice. A field hidden by such a rule must not be required, or nobody can register. And if someone changes their answer from "Limited company" to "Private customer", the VAT number they typed earlier should not stay behind in their account.
How Customer Attributes does it
Customer Attributes is our module for adding customer and address fields on Magento Open Source and Adobe Commerce without code. You create them under CommerceGears > Customer Attributes > Manage Attributes. Input types are text, text area, number, date, Yes/No, dropdown, radio buttons, multiple select, checkboxes, and file or image upload for customer attributes. Customer attributes appear on registration, account information and the admin customer form; address attributes in the Luma checkout's shipping and billing address forms, the address book and the admin address form.
Each attribute has a "Show Only When" setting: show this field only when a Yes/No or list attribute has one of the chosen values. That is the VAT number rule above. When the condition is not met, the field is hidden, not required, and its saved value is cleared when the customer saves the form.

The same screen lets you show a field only in some store views or for some customer groups, and make it required only in some store views or for some groups. Labels and option labels can differ per store view, so the German store can ask "Unternehmensform".
Every value is checked again on the server: required fields, lengths, character rules such as digits only, number ranges, dates, options that exist, and for uploads the file type, size and, for images, that the file really is an image. That also applies when customers write through REST or GraphQL: values they cannot edit on the storefront keep their saved value, and condition-hidden values are cleared.
Getting the answers to the people who need them
A field is only useful if someone sees the answer at the right time. With "Show on Orders" switched on, values are copied to each new order, with the labels as they were at the time, so renaming an option later does not rewrite old orders. They appear under the order addresses on the admin order page, in the customer's account, in order, invoice, shipment and credit memo e-mails and in the PDFs. For the furniture shop, that puts the VAT number on the invoice PDF and an address type such as "Business" in front of whoever books the courier.
Customer attributes can also be added as a column with a filter in the customer grid, and a CSV export lists every value per customer, protected against spreadsheet formulas.
What it does not do
Admin users and integrations are not held to the storefront rules: in the admin customer form every attribute is shown and nothing is required, which is usually what staff want. The customer group rules on the registration form use the store's default group for new accounts. Address attributes cannot be file uploads and cannot be grid columns. Hyvä Checkout and multi-address checkout are not supported; Hyvä stores use the Luma checkout fallback, and the registration, account and address book forms have Hyvä templates.
The module also does not check that a VAT number is valid or registered. It checks the format rules you set, such as letters and digits only. Whether and how you validate VAT numbers, and how that affects the tax you charge, is a separate decision for you and your accountant.
If one optional VAT field for everyone is acceptable, Magento's own setting is simpler. If your sign-up form serves two very different kinds of customer, fields that depend on the answer keep it short for both.
The Customer Attributes page lists every input type and rule, with screenshots of the forms on Luma and Hyvä.
Sources
- Magento Open Source 2.4.9 source code,
app/code/Magento/Customer/etc/adminhtml/system.xml(fields "Show Tax/VAT Number", "Show Company", "Show VAT Number on Storefront", website scope), checked 12 October 2026. ↩ - Adobe Commerce Admin documentation, "Customer address attributes", https://experienceleague.adobe.com/en/docs/commerce-admin/customers/customer-accounts/attributes/address-attributes, checked 12 October 2026. ↩
From our shop