disable some payment gateways if wallet balance is not low woocommerce code example
Example: woocommerce disable payment method if coupon appied and total is 0
add_filter('woocommerce_available_payment_gateways', 'applied_coupons_hide_payment_gateways', 20, 1 );
function applied_coupons_hide_payment_gateways( $available_gateways){
if( is_admin() )
return $available_gateways;
if( sizeof( WC()->cart->get_applied_coupons() ) > 0 ){
foreach ( $available_gateways as $gateway_id => $gateway ) {
if( $gateway_id != 'bacs' )
unset($available_gateways[$gateway_id]);
}
}
return $available_gateways;
}