How to Change Bank Withdrawal Form Fields (IBAN Placeholder) on Vendor Dashboard

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.

bank form

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.

Create a folder for child theme

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.


<?php

/*
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
*/

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

function wp1923_change_whithdraw_callback( $methods ) {

	$methods['bank']['callback'] = 'wp12232_render_bank_html';
	$methods ['bank']['title'] = __( 'Wire Transfer', 'dokan-lite' ); //title can be changed as per your need

	return $methods;
}

function wp12232_render_bank_html( $store_settings ) {
    $account_name   = isset( $store_settings['payment']['bank']['ac_name'] ) ? $store_settings['payment']['bank']['ac_name'] : '';
    $account_number = isset( $store_settings['payment']['bank']['ac_number'] ) ? $store_settings['payment']['bank']['ac_number'] : '';
    $bank_name      = isset( $store_settings['payment']['bank']['bank_name'] ) ? $store_settings['payment']['bank']['bank_name'] : '';
    $bank_addr      = isset( $store_settings['payment']['bank']['bank_addr'] ) ? $store_settings['payment']['bank']['bank_addr'] : '';
    $routing_number = isset( $store_settings['payment']['bank']['routing_number'] ) ? $store_settings['payment']['bank']['routing_number'] : '';
    $iban           = isset( $store_settings['payment']['bank']['iban'] ) ? $store_settings['payment']['bank']['iban'] : '';
    $swift_code     = isset( $store_settings['payment']['bank']['swift'] ) ? $store_settings['payment']['bank']['swift'] : '';

    // Get new added values like other one
    
    ?>
    <div class="dokan-form-group">
        <div class="dokan-w8">
            <input name="settings[bank][ac_name]" value="<?php echo esc_attr( $account_name ); ?>" class="dokan-form-control" placeholder="<?php esc_attr_e( 'Your bank account name', 'dokan-lite' ); ?>" type="text">
        </div>
    </div>

    <div class="dokan-form-group">
        <div class="dokan-w8">
            <input name="settings[bank][ac_number]" value="<?php echo esc_attr( $account_number ); ?>" class="dokan-form-control" placeholder="<?php esc_attr_e( 'Your bank account number', 'dokan-lite' ); ?>" type="text">
        </div>
    </div>

    <div class="dokan-form-group">
        <div class="dokan-w8">
            <input name="settings[bank][bank_name]" value="<?php echo esc_attr( $bank_name ); ?>" class="dokan-form-control" placeholder="<?php esc_attr_e( 'Name of your bank', 'dokan-lite' ) ?>" type="text">
        </div>
    </div>

    <div class="dokan-form-group">
        <div class="dokan-w8">
            <textarea name="settings[bank][bank_addr]" rows="5" class="dokan-form-control" placeholder="<?php esc_attr_e( 'Address of your bank', 'dokan-lite' ) ?>"><?php echo esc_html( $bank_addr ); ?></textarea>
        </div>
    </div>

    <div class="dokan-form-group">
        <div class="dokan-w8">
            <input name="settings[bank][routing_number]" value="<?php echo esc_attr( $routing_number ); ?>" class="dokan-form-control" placeholder="<?php esc_attr_e( 'Routing number', 'dokan-lite' ) ?>" type="text">
        </div>
    </div>

    <div class="dokan-form-group">
        <div class="dokan-w8">
            <input name="settings[bank][iban]" value="<?php echo esc_attr( $iban ); ?>" class="dokan-form-control" placeholder="<?php esc_attr_e( 'IBAN', 'dokan-lite' ) ?>" type="text">
        </div>
    </div>

    <div class="dokan-form-group">
        <div class="dokan-w8">
            <input value="<?php echo esc_attr( $swift_code ); ?>" name="settings[bank][swift]" class="dokan-form-control" placeholder="<?php esc_attr_e( 'Swift code', 'dokan-lite' ); ?>" type="text">
        </div>
    </div> <!-- .dokan-form-group -->

    <!-- add whatever you want -->
    <?php
}

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 –

updated form for IBAN placeholder

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.

Related Post

Rabbir Shad
Written by

Rabbir Shad

Shad is a WordPress enthusiast with keen sense in Movies. In his free time, he likes to play football and read books.

Have something to say? Cancel Reply

Your email address will not be published.

Table of Contents