WooCommerce: Enable/Disable Payment Method for a User Role

In this quick article we’ll show you how to disable a payment method for a specific user role.

This is useful if you want to allow registered customers only to pay using a credit card. In that case, guest customers (all those without an account in your site) won’t be able to pay with credit card.

Another situation where this applies is when you want wholesalers to pay with a bank transfer since those are greater amounts of money.

Therefore, we’ll use the WP Conditional Payment Gateways plugin because it helps you create conditions to enable/disable payment gateways. It’s really simple and you don’t need to use any PHP snippet.

Open WP Conditional Payment Gateways

When you open the plugin, you’ll see the Add condition button, which you need to hit in order to create a new condition.

Disable credit card for guest customers

To enable a payment method for a user role, you need to use these values in the condition you’re creating:

  • Enter the condition title in the Add new condition field.
  • Conditions: User role — Not equal to — Guest customer
  • Enabled payment gateways: Stripe, for example
  • Click on Publish

Enable bank transfer for wholesalers

To enable a payment method for a user role, you need to use these values in the condition you’re creating:

  • Enter the condition title in the Add new condition field.
  • Conditions: User role — Equal to — Wholesaler
  • Enabled payment gateways: Stripe, for example
  • Click on Publish

Done!

Now your payment method will be disabled or disabled for the user role you’ve selected.

Leave a Reply

Close Menu