Dokan has multiple payment systems to maintain the transaction process. One of them is “Bank Transfer”. Admins use bank transfers to send commissions directly to the vendor's account. It is one of the popular forms of withdrawal method.

Vendors need to fill out the default bank withdrawal form with the necessary information in order to receive commission through bank transfer.

However, based on the region or country, the system of the bank transfer can change. Some country needs you to provide Swift code whereas some want the IBAN number. Some country calls the IBAN number the Routing number.

Although you can make certain adjustments to Dokan, you can't change the fields like IBAN placeholder without some customizations. You need to add a simple code in order to adjust the form fields of the bank withdrawal form.

We will show you how you can customize the default bank withdrawal form field of Dokan.

3 Steps to Customize the Default Bank Withdrawal Form in Vendor Dashboard

The Bank transfer method fields are coming from the dokan-lite/includes/withdraw-functions.php file. Now there are no default settings to change the label or remove the field. You can only add some codes to change the label. There is a filter on the withdraw method register function- dokan_withdraw_register_methods  which is dokan_withdraw_methods. We will use this filter to do the job.

  • Step1: Install a Child Theme
  • Step2: Insert Code into Functions.Php
  • Step3: Check the changes from frontend

Step 1: Install a Child Theme

When you are doing any kind of customizations, you need to use your child theme. Otherwise, you risk losing your data after updating your plugin or themes. So, create a Child theme if you haven't on your marketplace.

Step 2: Insert Code on Child Theme's Functions.Php file

Open your folder/finder and navigate to WP-Content–> Themes–> Your Child Theme Name–>Open Functions.php. Copy the below code.


/*
You can change any field title or remove any feild for the vendor -> settings -> payment -> bank transfer method. Please note that this
code need to be placed on your child-theme functions.php file
*/

/**
* Change the payment title
*
* @param array $methods
*
* @return array
*/
function dokan_2022_change_whithdraw_callback( $methods ) {
   $methods ['bank']['title'] = __( 'Wire Transfer', 'dokan-lite' ); //title can be changed as per your need

   return $methods;
}

add_filter( 'dokan_withdraw_methods', 'dokan_2022_change_whithdraw_callback', 12 );

/**
* Change the bank payment fields labels and placeholders
*
* @param array $fields
*
* @return array
*/
function dokan_2022_change_bank_payment_fields_placeholders_and_labels( $fields ) {
   $fields['ac_name']  = [
       'label'       => __(  'Account Holder', 'dokan-lite' ),
       'placeholder' => __( 'Your bank account name', 'dokan-lite' ),
   ];

   $fields['ac_type']  = [
       'label'       => __(  'Account Type', 'dokan-lite' ),
       'placeholder' => __( 'Account Type', 'dokan-lite' ),
   ];

   $fields['ac_number'] = [
       'label'       => __(  'Account Number', 'dokan-lite' ),
       'placeholder' => __( 'Account Number', 'dokan-lite' ),
   ];

   $fields['routing_number'] = [
       'label'       => __(  'Routing Number', 'dokan-lite' ),
       'placeholder' => __( 'Routing Number', 'dokan-lite' ),
   ];

   $fields['bank_name'] = [
       'label'       => __(  'Bank Name', 'dokan-lite' ),
       'placeholder' => __( 'Name of bank', 'dokan-lite' ),
   ];

   $fields['bank_addr'] = [
       'label'       => __(  'Bank Address', 'dokan-lite' ),
       'placeholder' => __( 'Address of your bank', 'dokan-lite' ),
   ];

   $fields['iban'] = [
       'label'       => __(  'Bank IBAN', 'dokan-lite' ),
       'placeholder' => __( 'IBAN', 'dokan-lite' ),
   ];
   $fields['swift'] = [
       'label'       => __(  'Bank Swift Code', 'dokan-lite' ),
       'placeholder' => __( 'Swift Code', 'dokan-lite' ),
   ];
   $fields['declaration'] = [
       'label'       => __(  'I attest that I am the owner and have full authorization to this bank account', 'dokan-lite' ),
       'placeholder' => __( '', 'dokan-lite' ),
   ];
   $fields['form_caution'] = [
       'label'       => __( 'Please double-check your account information!', 'dokan-lite' ),
       'placeholder' => __( 'Incorrect or mismatched account name and number can result in withdrawal delays and fees', 'dokan-lite' ),
   ];

   return $fields;
}

add_filter( 'dokan_bank_payment_fields_placeholders', 'dokan_2022_change_bank_payment_fields_placeholders_and_labels' );

Don't forget to save the code after you are done editing.

Step 3: Refresh Your Website & You Will See That The Labels Have Changed

After saving your code, go back to your marketplace and give a hard refresh. Then you will see that that Bank transfer label has been changed and also some of the placeholder's text are changed –

This is how you can change the default Bank Withdrawal form in the vendor dashboard.

You can also check: How to Add New Fields in Dokan Product Form.

Make the Necessary Changes & Manage Your Vendors More Efficiently

When you have an open-source platform like WordPress and a plugin like Dokan, making customizations become easy.

Instead of adding plugins and hampering the performance of your marketplace, customize using codes. This will make your marketplace efficient and you will have more room to add the plugins you actually need.

With the above code, you can also change the text Name of Bank to Name of your Bank on the vendor settings area or you might need to change the Bank Transfer to Wire Transfer.

If you face any problems, do let us know in the comment section.

Written by

Rabbir Shad

Shad is a Content Writer with expertise in eCommerce, SEO, WordPress, and Technology. He has a passion for Football. Besides, he likes to spend time reading a quality book or watching any classic film.