Creating User Role-dependent Fields?
Custom Fields for WooCommerce gives you the freedom to create fields that are dependent on user roles.
To create a new field that is dependent on user roles, follow the steps below:
Go to WooCommerce > Custom Fields > Add New Field.
Enter the Field Details:
- Add field label
- Select field type:
- Text
- Text area
- Select box
- Multi-select box
- Checkbox
- Multi-checkbox
- Radio button
- Number
- Password (accept secret input)
- File upload (limit file types and size)
- Color picker
- Date picker (calendar)
- Time picker
- Google ReCaptcha
- Heading
- Message
- VAT field
- Privacy text
Create Field Dependency:
- To create field dependency, create user roles for which you want to show this field on the page. User roles are listed below:
- Administrator
- Editor
- Author
- Contributor
- Subscriber
- Customer
- Shop manager
- Wholesale
- B2B
- Retailer
- Guest
Note: Leave empty to display field for all.
Make Fields Dependable:
- To make a field dependent on another field, select ‘Yes’ from the dropdown.
- Choose the field from the dropdown to specify the field it is dependent on.
Configure the field formatting and field status to finish creating a new user role-dependent field.
Click on ‘Publish’ when you are done.