Plugins like TeraWallet, WC Wallet (among others) allow you to add a wallet credit system to your WooCommerce store.
This tutorial focuses on showing you how to easily disable the Wallet payment gateway for specific products or categories in WooCommerce without any codes needed.
This can be really difficult if you try to program that conditional restriction to your payment gateways in WooCommerce. You need to have decent programming knowledge.
Fortunately, we’ll do it really easily with the WooCommerce Conditional Payment Gateways plugin. It allows you to apply any conditional restriction to your payment gateways. You can restrict payment methods using cart info, user info, or product info.
In this case, WooCommerce Conditional Payment Gateways will be really helpful to select specific products or product categories and disable the Wallet payment gateway for them.
Just follow these simple steps:
Step 1. Install Conditional Payment Gateways
You can download the plugin here:
Download WooCommerce Conditional Payment Gateways Plugin - or - Read more
Step 2. Create a new payment gateway condition
Important: In this example, we’re using the TeraWallet plugin for our wallet system.
Once you install and activate the CPG plugin, you need to create a new condition for your gateways. It’s important to mention that we assume you already enabled the Wallet payment gateway in WooCommerce payment settings.
- Go to WooCommerce > Conditional Payment Gateways.
- Tick the Enable conditions so the condition applies from the moment you publish it. You can edit this later on though.
- Click Add condition.
Step 3. Disable the Wallet payment gateway for products or categories
Once you add the new condition, you need to select the following values to disable the Wallet payment gateway for specific products or categories.
a) Disable Wallet gateway for specific product(s)
- Enter the condition title
- What happens when the conditions are met: Disable payment method(s)
- Select the payment methods: wallet
- Condition 1: Contains product = Select the product the order has to contain to disable the Wallet gateway.
- Optional: You can click Add ‘Or’ group to add an optional product as you see in the screenshot.
- Publish the condition.
Note: If instead of an optional product you want to add more products, click the “+” button next to the Condition 1 to add an “And” condition. Just keep in mind the order must contain all the selected products.
b) Disable Wallet gateway for specific categories
- Enter the condition title
- What happens when the conditions are met: Disable payment method(s)
- Select the payment methods: Wallet
- Condition 1: Category = Select the category for which you’ll disable the Wallet gateway.
- Optional: You can click Add ‘Or’ group to add an optional product category. See the screenshot.
- Publish the condition.
Note: If instead of an optional category you want to add more categories, click + to add an “and” condition. Just keep in mind the order must contain products from both categories.
c) Disable Wallet gateway for both specific products and categories
If you want to disable the Wallet payment method for a specific product and an entirely different category, you can do it easily.
This way, the Wallet payment gateway will be disabled whether the user buys the selected product, or buy products from a different selected category.
Just select these values:
- Enter the condition title
- What happens when the conditions are met: Disable payment method(s)
- Select the payment methods: Wallet
- Condition 1: Contains product = Select the category for which you’ll disable the Wallet gateway.
- Click Add ‘Or’ group to add the product category.
- Condition 1: Category = Select the category for which you’ll disable the Wallet gateway.
- Publish the condition.
Here you can see that the Wallet gateway has been disabled for these products. It doesn’t appear on the available payment methods:
Disabling payment gateways is really simple!
As you see, you can forget about the strange codes found out there on the internet. You don’t need to be an experienced programmer to apply advanced restrictions to your payment gateways. Conditional Payment Gateways makes it really easy for you!4
You can download the plugin here:
Download WooCommerce Conditional Payment Gateways Plugin - or - Read more
You can also read: WooCommerce – How to Restrict Payment Methods for Wallet Deposits