If you wish to get additional information from the customer in the registration form, you can easily do it with ACF for WooCommerce. No coding is required. It is achieved with the help of Advanced Custom Field free or PRO version of the plugin.
An admin can easily create custom fields (ACF) for customers while he is creating his account in the register form. While creating a custom field using Advance Custom Field, the admin needs to select “Customer Edits Allowed” so that the customer can use that custom field.
If you wish the customer to enter that value in the registration form then select Customer Register Form. If you do not select it, the custom field can be added from the edit account page, once the user is logged in. There will be no change in the customer registration form.
The admin needs to select User Role equal to Customer in the custom field location rules to make this setting work. Please check the below screenshot for clarity.
That is not all. What to do if the customer wants to change that value later on. That is also possible with the plugin. After customers log in, they can update the custom fields from the edit account page.
The supported field types of ACF are text, textarea, number, URL, select, checkbox, radio, file, and email.
Now, the field is created for a customer. You can use the below ACF functions to display the value:
the_field( ‘field_name’, ‘user_1’ ); // where 1 indicates user ID
echo get_field( ‘field_name’, ‘user_1’ ); // where 1 indicates user ID
ACF For WooCommerce is also compatible with the multivendor marketplace plugin Dokan and ACF For Dokan PRO.