Disable a specific payment gateway in WooCommerce by adding this to your custom plugin or function.php in your theme. You can also add multiple user roles with the plugin Members and change payment gateway for different roles.
1 2 3 4 5 6 7 8 9 |
function disable_invoice_for_regular_customers($available_gateways){ global $woocommerce; if(isset($available_gateways['cheque']) && current_user_can('customer')){ unset($available_gateways['cheque']); } return $available_gateways; } add_filter('woocommerce_available_payment_gateways', 'disable_invoice_for_regular_customers'); |