Josh, I’m not sure what you mean by “
Hi @envywigs yep, you can do this by reversing the condition from === to !==“
I created a new user role “net 30” that I want to ENABLE the invoice gateway for (this role only). The code provided says to “stop_payment_gateway”…. are there other components that should be updated??Thank you!
add_action(‘woocommerce_available_payment_gateways’,’Stop_Payment_Gateway’);
function Stop_Payment_Gateway($available_gateways){
if(is_user_logged_in()){
global $current_user;
if($current_user->roles[0] === “administrator”){
//stop invoice for admin customer
if(is_checkout()){
unset($available_gateways[’igfw_invoice_gateway’]); // Add the payment Code ID here
}
}
}
return $available_gateways;
}