In this article, we will show you how to allow a specific payment gateway for your wholesale customers using your WooCommerce powered store. Allowing a better experience for both your customers and wholesale customers.
Prerequisites
- Installed latest version of Wholesale Customers For WooCommerce.
- Basic knowledge of working with Code Snippets Plugin or adding a code recipe to your WordPress site.
Setup Your Payment Gateways For WooCommerce
This method requires all payment gateways to be activated inside your WooCommerce settings. We will then use a code snippet to disable these payment gateways for non-wholesale customers. You may do the following steps to enable a payment gateway for WooCommerce:
- Login to your WordPress dashboard and navigate to your WooCommerce settings.
- Navigate to the Payment Tab to enable your payment gateways.
- Enable all your payment gateways you want to offer all your customers.
- Save your settings
Your WooCommerce payment settings may look something similar to this:
Code Recipe
The below code will hide payment gateways for wholesale customers. Please adjust line 18 of the code recipe to hide specific payment gateways for regular customers. In our case, only the Check Payments will be an available payment option for wholesalers.
Once this code is added to your site, wholesale customers won’t be able to see all payment options. You can easily reverse this logic to hide payment options for regular customers. If you need assistance with this, please do not hesitate to reach out to our support team or leave a comment below.
Photo by Michael Longmire on Unsplash