niikk
Forum Replies Created
-
Hi @rur165
Thanks. Got it.
Last question is, how to display “Bank Adress” in dokan withdraw backend https://prnt.sc/u18z1y
We need the Adress for the Banktransfer order.
Thanks. π
hello @rur165
Thanks. We now option “adaptive” gateways. But we can not use those with our bank. So we have to do custom work for this automatic bank transfer process. Maybe this is also something for a feature request? I mean, this is not a very uncommon use case I guess.
Other Vendor Plugin does offer such a solution. Can’t understand why dokan “The Best Way To Build Marketplace” solution does not offer such a easy and base solution.
Can you maybe explain more why thsi is not available by default? π
Cheers
hello @rur165
Thanks. I’m familiar with hooks. The code below should go into the function.php or code snipped plugin. But I can’t add because the function dokan_get_seller_active_withdraw_methods can’t be there with out rename becuase its a conflict with the original function. So I have to rename this function like dokan_get_seller_active_withdraw_methods_2 but then the code does not work because dokan wants to have the original function.
In which file is set, on which dokan will call up the filter? If this is somewhere in /Templates/ I can override the call up via child theme and then it should work. π
/** * Get active withdraw methods for seller. * * @since 3.0.0 add $vendor_id param * * @param int $vendor_id Seller vendor id * * @return array */ function dokan_get_seller_active_withdraw_methods_2( $vendor_id = 0 ) { $vendor_id = $vendor_id ? $vendor_id : dokan_get_current_user_id(); $payment_methods = get_user_meta( $vendor_id, 'dokan_profile_settings' ); $paypal = isset( $payment_methods[0]['payment']['paypal']['email'] ) && $payment_methods[0]['payment']['paypal']['email'] !== false ? 'paypal' : ''; $bank = isset( $payment_methods[0]['payment']['bank']['iban'] ) && $payment_methods[0]['payment']['bank']['iban'] !== '' ? 'bank' : ''; $skrill = isset( $payment_methods[0]['payment']['skrill']['email'] ) && $payment_methods[0]['payment']['skrill']['email'] !== false ? 'skrill' : ''; $payment_methods = [ $paypal, $bank, $skrill ]; $active_payment_methods = []; foreach ( $payment_methods as $payment_method ) { if ( ! empty( $payment_method ) ) { array_push( $active_payment_methods, $payment_method ); } } return apply_filters( 'dokan_get_seller_active_withdraw_methods_2', $active_payment_methods, $vendor_id ); }- This reply was modified 5 years, 10 months ago by niikk.
hello @rur165
Thanks. So I changed the setting now to IBAN. Should be fine now.
But how can I implement this? I mean, it’s in the /includes/ folder from dokan. With child theme does it not work. And always chnage the file after update is not very cool.
I tried to insert the code via code snipped plugin. But I get the error “Cannot redeclare function dokan_get_seller_active_withdraw_methods.”
Two question:
– Does the code adjustmenst looks good? Or do I have to adjust some more?
– Best way to include this into our system?Code adjustment:
$bank = isset( $payment_methods[0]['payment']['bank']['iban'] ) && $payment_methods[0]['payment']['bank']['iban'] !== '' ? 'bank' : '';Full Code:
/** * Get active withdraw methods for seller. * * @since 3.0.0 add $vendor_id param * * @param int $vendor_id Seller vendor id * * @return array */ function dokan_get_seller_active_withdraw_methods( $vendor_id = 0 ) { $vendor_id = $vendor_id ? $vendor_id : dokan_get_current_user_id(); $payment_methods = get_user_meta( $vendor_id, 'dokan_profile_settings' ); $paypal = isset( $payment_methods[0]['payment']['paypal']['email'] ) && $payment_methods[0]['payment']['paypal']['email'] !== false ? 'paypal' : ''; $bank = isset( $payment_methods[0]['payment']['bank']['iban'] ) && $payment_methods[0]['payment']['bank']['iban'] !== '' ? 'bank' : ''; $skrill = isset( $payment_methods[0]['payment']['skrill']['email'] ) && $payment_methods[0]['payment']['skrill']['email'] !== false ? 'skrill' : ''; $payment_methods = [ $paypal, $bank, $skrill ]; $active_payment_methods = []; foreach ( $payment_methods as $payment_method ) { if ( ! empty( $payment_method ) ) { array_push( $active_payment_methods, $payment_method ); } } return apply_filters( 'dokan_get_seller_active_withdraw_methods', $active_payment_methods, $vendor_id ); }Hi,
Now we found a problem. We adjust the Payment Methode fiels with this code here:
/* 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'] = __( 'Bank Γberweisung', '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( 'Name / Vorname', '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 der 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( 'Adresse der 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][iban]" value="<?php echo esc_attr( $iban ); ?>" class="dokan-form-control" placeholder="<?php esc_attr_e( 'IBAN', 'dokan-lite' ) ?>" type="text"> </div> </div> <!-- .dokan-form-group --> <!-- add whatever you want --> <?php }So a vendor can only fill out these fields. But when he want to make a withdraw, he get the message “No withdraw method is available. Please update your payment method to withdraw funds. Payment Settings Setup”
It seems, that the other fiels (which we hide) are required. How can we adjust this?
Cheers
Hey @nazreenexe
We also looking for such a solution. Maybe you can share your experience afterwards? π
Many thanks!
Cheers
hi @rur165
I guess the problem has something todo with the payment gateways. I use a Plugin form a bank service and it does not work (vendor order info mail not send) when a customer use this payment gateways. If a customer use a other gateway like “Cash on delivery” the vendor oder emial is send. So I guess there is no issue with dokan here…
But, maybe u can help me with the following to fix this.
This Dude has the same problems… how can I force to send dokan vendor mails? any hooks or something which I can use to fix this?
Cheers
hi @rur165
I send you a mail last Tuesday back after you send me your report. Did u get it?
Hello @rur165
Great! Nice! Works!
I now noticed, that the filter βallβ also count the βfailedβ orders which we hide. Can we also adjust this count that the number is right?
Cheers
Hello @rur165
Thanks! Works as expected!
But now there is only a little issue with the top filter for order filtering. There is still a filter for “failed”. And I saw, that dokan don’t use a special CSS class for this. How can I hide the filter “Failed” there as well?
Cheers
hi @rur165
Thanks for your reply.
Here is a screenshot: https://ibb.co/dpt8rD5
We want to hide failed orders in the vendor dashboard orders overview. Vendor should not see “Failed” order there.
Cheers
Hey @rur165
Ok, I send out the mail again with a reference to the case. Please check the inbox π
Cheers
Hello @rur165
Is there a way to rename the button instead of removing it?
I didn’t see any translation value for this in the Dokan translation file.Cheers