Would you like to add the ACF field to the Dokan order, registration, or product forms? You are at the proper location. I swear you won’t have to perform any coding.
I’m assuming you’re utilizing the plugin’s free version. You also want a few extra features. Applying the custom field to the product add or edit form is something you already know how to do.
Admins can easily create custom fields for vendors in the vendor registration form. While creating a custom field using Advance Custom Field, the admin needs to select ‘Vendor Edits Allowed’ so that field is visible in the registration form.
The admin needs to select User Role equal to Vendor in the custom field location rules to make this setting work. After vendor login, they can update the custom fields from the edit account page. The supported field types of ACF are text, textarea, number, URL, select, email, checkbox, radio, file.
Now, the field is created for a vendor. 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
When the admin creates custom fields from the ACF plugin for the Order post type, the Vendor will be also able to add/update values for orders from their dashboard.
You can use ACF functions like the_field, get_field to display the custom field value of the vendor.
You can display its value using these functions:
the_field(‘text_field’, 123); // where 123 is the order id
echo get_field( “text_field”, 123 ); // where 123 is the order id
Now, you can setup the custom field editable with the Dokan Setup Wizard. There will be a new setting field called Allowed in Setup Wizard? if you enable Vendor Edits Allowed.
If the field Allowed in Setup Wizard is enabled, the vendor will see the custom field in the setup wizard.
The plugin will work with ACF and Dokan free as well as PRO versions.