How to Create User Role-dependent Fields?

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:

  1. Add field label
  2. Select field type:
    1. Text
    2. Text area
    3. Email
    4. Select box
    5. Multi-select box
    6. Checkbox
    7. Multi-checkbox
    8. Radio button
    9. Number
    10. Password (accept secret input)
    11. File upload (limit file types and size)
    12. Color picker
    13. Date picker (calendar)
    14. Time picker
    15. Google ReCaptcha
    16. Heading
    17. Message
    18. VAT field
    19. Privacy text

Create Field Dependency:

  1. 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:

  1. To make a field dependent on another field, select ‘Yes’ from the dropdown. 
  2. 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.