Add shipping fields to customer extended registration form
Saturday, 28 August 2021
WooCommerce B2B among its many features has the possibility to extend the customer registration form by entering the billing address fields, simply enable the “Extended registration form” option in the plugin settings page.
WooCommerce B2B has a dedicated hook to manage and customize this form!
To expand this form even further and also enter the shipping address fields, edit functions.php file that you find in your site’s FTP space in:
and insert this code:
The fields of the billing and shipping addresses may have the same labels, creating confusion for the customer during registration. I therefore suggest that you customize the labels, so as to differentiate them from each other, for example:
It will transform the default label of the shipping address name “First name” into “Shipping first name”.
It is advisable not to edit the theme files directly, but to use a child theme.
For more information on child themes, please read: WordPress Official guide on Child Themes