• Resolved guineder

    (@guineder)


    Hello! I am trying to remove the “Bank Address” field on the bank withdrawal settings.

    I have a child theme installed and already inserted this code using the Code Snippets plugin, however when I delete the fields it just doesn’t work in the frontend.

    Any ideas why?

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Jahidul Hassan Mojumder

    (@jahidulhassan)

    Hi @guineder

    I have had a look at the code and found out that, the elements that are declared under wp12232_render_bank_html this function will only be shown in the frontend.

    If you want to hide any of those elements then you can simply comment out that element or can remove the element and that element should not appear in the frontend anymore.

    Would you mind sharing how did you try to delete the fields and it was not working?

    Thread Starter guineder

    (@guineder)

    Hello @jahidulhassan , thanks for the reply.

    I tried removing both parts mentioning the bank_addr settings, like this:

    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’] : ”;
    $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″>
    <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
    }`

    Plugin Support Jahidul Hassan Mojumder

    (@jahidulhassan)

    Hi @guineder

    The third-party code you have referred to is working completely fine in terms of hiding an existing field of the Bank transfer method. All you will need to do is to remove the variable declaration for that field and also remove the <div> associated with that field and it should hide the field you have removed. I have tried it on my environment and found out this as an output.

    Sadly, this is not included under our support policy to review a custom code. For this reason, I will not be able to review your code any further.

    Thread Starter guineder

    (@guineder)

    Hi @jahidulhassan

    I found out that my theme (Cartzilla) is overriding some templates, so that’s why the code doesn’t work.

    I managed to comment out the field editing the cartzilla-dokan-functions.php file.

    Thanks for your help!

    Plugin Support Jahidul Hassan Mojumder

    (@jahidulhassan)

    Hi @guineder

    Great to know that you ended up achieving your goal. As you have got your solution, I am resolving this topic. Feel free to open another one if you have any further queries.

    Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Change bank withdrawal form fields on vendor dashboard’ is closed to new replies.