How to add custom fields in the wholesaler registration form
The Whols plugin for WooCommerce allows businesses to enhance their wholesale registration form with custom fields. This guide demonstrates how to add custom fields to WooCommerce B2B registration forms, helping collect essential business information from potential wholesale customers beyond the default registration fields.
Accessing the Fields Manager #
The WooCommerce wholesale registration fields can be accessed through WordPress Dashboard → Whols → Settings → Registration & Login → Fields Manager to manage the registration field configuration.
Default Fields #
The Fields Manager comes with four default registration fields that handle basic wholesale customer information: Name, Username, Email, and Password.
Adding a Custom Field #
Adding new wholesale registration fields starts with clicking the blue ╋ button below the existing fields. The Field dropdown menu offers Three main options:
Field Type Selection #
- Custom Field When selected, this allows creating custom fields from scratch with complete configuration options.
- General Contains pre-built options including:
- Wholesaler Roles: Adds a role selection option to the registration page
- WooCommerce: Add billing fields to your wholesale registration form to make shopping easier for your customers. When they register, they can fill in their company name, address, city, postal code, country, state, and phone number. These details are saved automatically. When wholesale customers shop later, all their billing information appears automatically at checkout – no need to type it again! Of course, they can still change this information anytime, either in their account or while checking out.
Custom Field Configuration #
When “Custom Field” is selected, the following configuration options become available:
- Text: The Text field type creates a single-line input field in the wholesale registration form for collecting brief information like company names, phone numbers, or other short details.
- Textarea: A Textarea provides a larger input box allowing multiple lines of text input, ideal for business descriptions or detailed addresses in the wholesale registration form.
- Select: The Select field creates a dropdown menu with predefined options (
using key|value pairs
), letting wholesalers choose from a list of options like business categories or industry types. - Checkbox: Checkbox fields enable either single or multiple selections using
key|value
pairs, perfect for terms acceptance or selecting multiple business categories in the registration form. - Radio: Radio fields display multiple options where wholesalers can select one choice, showing all options visually on the form for selections like business size or account type.
- File/Upload: The File/Upload field allows wholesalers to submit documents with configurable file type restrictions (
JPG, PNG, GIF, PDF, DOC
) and size limits (default 2MB) for business licenses or certifications.
Note: Each field type may show additional relevant options. For Example, selecting “File/Upload” reveals:
- Allowed File Types selection
- Maximum File Size setting
The custom field configuration includes several essential settings that determine how the field functions and appears on the wholesale registration form:
- Field Unique Name A unique identifier used to store field values in the database. Must be unique across all fields.
- Label The visible field label displayed on the registration form
- Placeholder Optional text shown inside the field before user input
- Description Additional information about the field’s purpose
- Default Value Pre-filled value for the field if desired
- Required? Specify if the field must be filled out
- Class Add custom CSS classes for additional styling
Frontend Result #
The new custom wholesale registration fields appear on the registration form alongside the default fields, creating a comprehensive WooCommerce B2B registration process.