@amir3233,
Please use below code to theme function.php file.
add_filter('woocommerce_available_payment_gateways', 'woocommerce_available_payment_gateways_callback');
if(!function_exists('woocommerce_available_payment_gateways_callback')){
function woocommerce_available_payment_gateways_callback( $available_gateways ){
if(!is_admin() && !is_full_payment_through_wallet()){
if(isset($available_gateways['cod'])){
unset($available_gateways['cod']);
}
}
return $available_gateways;
}
}
Thanks for your replay
Please see the link https://r2sell.com/wp-content/uploads/2018/11/sdf.png
here if the user selects the check box of pay by wallet then hide cod.if not then both the payment option should avail for user.
Is there anyone to reply ???
@amir3233,
Sorry for delayed response. The functionality you are requested is not possible. As WooCommerce doesn’t refresh payment gateway options upon certain condition.
Thank you.
@amir3233,
Now, this option is available in the latest WooCommerce version. Please update WooCommerce plugin to the latest version and use below code to theme function.php file.
add_filter('woocommerce_available_payment_gateways', 'woocommerce_available_payment_gateways_callback');
if(!function_exists('woocommerce_available_payment_gateways_callback')){
function woocommerce_available_payment_gateways_callback($_available_gateways){
if(isset($_available_gateways[ 'cod' ]) && is_enable_wallet_partial_payment()){
unset($_available_gateways[ 'cod' ]);
}
return $_available_gateways;
}
}
Thank you.
Hey i used this code but the checkbox is coming on the right side. How can i put the checkbox on left side?
check this image- http://www.mediafire.com/view/4zg1iaj66l12s8b/Wallet_tick.png/file
@veneetsayyer11 for that you have to override partial payment template in the theme folder.
when user cart value exceed the wallet balance , it automatically detect from wallet
please stop that, customer want keep the wallet balance.
stop automatic detect from wallet to pay.
https://prnt.sc/nu6oby
https://prnt.sc/nu6nzw
Hi @thiru12
Please disable “Auto deduct wallet balance for partial payment” option. You can find this option under TeraWallet > settings > General tab.
Thank you.
Yes, i disabled partial payments but yet it keeps bringing button/check box asking if user want to deduct from wallet… Please i need to stop this.
Please use below code in theme function.php file to disable partial payment.
add_filter('woo_wallet_disable_partial_payment', '__return_true');
this code is not working anymore
add_filter(‘woocommerce_available_payment_gateways’, ‘woocommerce_available_payment_gateways_callback’);
if(!function_exists(‘woocommerce_available_payment_gateways_callback’)){
function woocommerce_available_payment_gateways_callback($_available_gateways){
if(isset($_available_gateways[ ‘cod’ ]) && is_enable_wallet_partial_payment()){
unset($_available_gateways[ ‘cod’ ]);
}
return $_available_gateways;
}
}
I need woo wallet deduct hook, I’m planning on using in customized code which I’m currently using for mycred deduct on gravityform submission.
How can I make sure that my customers use only 20% money from his Tera wallet?