Description
Some payment methods only make sense some of the time. Cash on delivery only when the customer picks local pickup. Invoice on orders over a certain amount. A wholesale gateway only for wholesale customers. This plugin adjusts the payment methods at checkout when the cart matches a rule you set, and leaves them alone the rest of the time.
Each rule is one line — choose a condition, set the value, then either hide the payment methods you pick or show only those. Add as many rules as you like, under WooCommerce Payment Rules. No sprawling settings, nothing phoning home.
Conditions you can check:
- Cart total — less/greater than an amount (toggle “exclude shipping” to compare without the shipping cost).
- Item count — less/greater than a number of items.
- Shipping country — is / is not one of a list of ISO codes (e.g.
SE, NO). - Shipping method — is / is not one of the shipping methods you tick, listed per shipping zone.
- Customer role — is / is not a given role, including “Guest” for logged-out visitors.
- Cart contents — digital only (nothing needs shipping), or contains a physical product.
What a rule does when it matches:
- Hide these methods — the methods you picked are removed. This is what every rule did before 1.5.0, and it stays the default.
- Show only these methods — the methods you picked are the only ones left at checkout.
Typical uses: hide cash on delivery unless the customer chose local pickup, hide the invoice option on small orders, show only card payment when shipping abroad, or offer a B2B method only to a wholesale role.
Keeping a screen of rules in order:
- Switch a rule off to park it without deleting it. An off rule changes nothing at checkout, which is the quickest way to find out which rule is responsible for what.
- Name a rule if you want to. The name is only for you — customers never see it, and it plays no part in matching.
- Values are checked when you save. A rule that could never match — letters where an amount belongs, a country code that does not exist, a shipping method you have since deleted — is refused with the reason on its own row, instead of being saved and then quietly doing nothing.
What this plugin does not do: it does not track you, it does not send anything anywhere of its own, and it loads no third-party JavaScript in your admin. No opt-in screen, no review nagging, no support widget, and no greyed-out “Pro” conditions padding out the rule form. There is a Pro add-on and the settings page links to it once — that is the whole of it.
Pro add-on
One condition per rule is free, and stays free. If you need several conditions in a single rule combined with AND or OR, there is a separate Pro add-on; the settings page links to it. Everything described above works without it.
Screenshots

Installation
- Install and activate the plugin. WooCommerce must be active.
- Go to WooCommerce Payment Rules.
- Add one or more rules and save. Each rule hides — or keeps only — its payment methods when the cart matches.
FAQ
-
Which cart amount is compared?
-
By default the order total — what the customer actually pays, including shipping. On the “Cart total” condition you can toggle exclude shipping to compare the total without the shipping cost.
-
Can one rule target more than one payment method?
-
Yes. The method picker is a searchable multi-select, so a single rule can hide — or keep — several gateways at once.
-
Can I show a method only in some cases instead of hiding it?
-
Yes. Set the rule to show only these methods: when it matches, the methods you picked are the only ones the customer sees.
-
What if a “hide” rule and a “show only” rule match at the same time?
-
Hide wins. Everything a matching “show only” rule allows stays available, and then anything a matching “hide” rule targets is removed from what is left. If two “show only” rules match at once, both their sets stay on offer, so two rules can never cancel each other out. If your rules leave nothing at all, the checkout shows no payment methods and WooCommerce says so — that is the rules doing exactly what they say.
-
How does the shipping-method condition know what the customer picked?
-
It reads the shipping method chosen for the cart (WooCommerce’s
chosen_shipping_methods), so the rule reacts as soon as the customer switches method — no page reload on either checkout. Tick a method under the zone it belongs to. A cart that needs no shipping has no chosen method, so “is” never matches and “is not” always does. -
Does it work with the block checkout?
-
Yes. It filters
woocommerce_available_payment_gateways, the list WooCommerce builds the payment options from on both the classic and the block checkout. On the block checkout the list updates as the customer edits the cart, the shipping address or the shipping method — no page reload needed. -
Why will it not let me save my rule?
-
Because the value cannot match anything. “Cart total” and “Item count” need a number, “Shipping country” needs two-letter ISO codes such as SE or NO, and a shipping-method rule needs at least one method that still exists. The rule that has the problem says so on its own row. Nothing is saved while a rule is in that state, so the rules you already had keep working while you fix it.
-
What does switching a rule off do?
-
Nothing happens at checkout for that rule — it is treated as if it were not there — but the rule itself is kept, so you can switch it back on later. It is the quickest way to find out which of your rules is hiding a payment method: turn one off, reload the checkout.
-
Does the name of a rule change anything?
-
No. It is a label for your own use in the rules table. Customers never see it, and it takes no part in matching.
-
What happens to rules made in older versions?
-
They keep working, untouched. Rules saved as a single payment method in 1.0 and 1.1 are read as-is, rules from before 1.5.0 have no action stored so they keep hiding exactly as they did, and rules from before 1.6.0 have no on/off switch and no name stored, which means on and unnamed. Saving such a rule again without changing it stores exactly the same thing it stored before.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“Jalma Conditional Payment Methods” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “Jalma Conditional Payment Methods” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.6.2
- Renamed to “Jalma Conditional Payment Methods”. WordPress.org now blocks the word “WooCommerce” in a plugin’s display name and permalink outright, so the previous name could not be submitted. Nothing changed in how the plugin works, and no settings were touched. The slug is unchanged.
1.6.1
- The rule row is readable on a phone. Below 782 px the seven-column table becomes a labelled list instead of squeezing seven columns into the screen — at 390 px both select menus had collapsed to about 38 px, showing neither the condition nor the operator, so the rule this plugin exists to build could not be read. Same fields, same order, no new component. This shipped as 1.6.0 in the source but never reached a build.
1.6.0
- The value field is checked before a rule is saved. Letters in “Cart total”, a country code that does not exist, an empty value, a shipping method that has been deleted — the save is refused, the field is marked, and the reason is printed on that rule’s own row. Before this, such a rule saved happily and then quietly never fired.
- Rules already saved with an unusable value are not touched. They load as before and are marked invalid, so you can see which rule has been doing nothing.
- A decimal comma (“500,50”) is now accepted and stored as “500.50”. It used to be read as 500.
- The payment-method picker shows your store’s own titles, for example “Faktura”, instead of WooCommerce’s generic names like “Direct bank transfer”. Only the label changed; rules still match on the payment method itself.
- A rule can be switched off without deleting it. An off rule changes nothing at checkout, and the table shows which rules are off.
- A rule can be given a name, for your own reference. It is optional, never shown to customers, and does not affect matching.
- Rules saved in older versions are unchanged: no name and no on/off switch stored means on and unnamed, exactly as they behaved before.
1.5.0
- New condition: shipping method. Tick the shipping methods a rule should react to, listed per shipping zone — so you can finally hide cash on delivery unless the customer picked local pickup. Works on both the classic and the block checkout, and follows the customer’s choice without a page reload.
- New per-rule action: show only these methods. A rule can now keep just the methods you pick instead of hiding them, so “card payment only when shipping abroad” is one rule rather than one rule per method you want gone.
- Rules made before this release are unchanged and behave exactly as before: no action stored means hide, which is what they always did.
1.4.2
- Renamed to “Payment Method Rules for WooCommerce” — same plugin, clearer name. Nothing changed in how it works, and no settings were touched.
- Readme corrected: a rule can target several payment methods, not just one.
1.4.1
- The Pro upgrade box now offers a direct download of the Pro add-on’s .zip alongside the existing link to its plugin page, so you can install Pro and buy the license from inside it if you prefer. Both are plain links — this plugin still installs, activates and downloads nothing on your behalf, and contacts no external server of its own.
1.4.0
- A link to the Pro add-on, which adds AND/OR groups so one rule can check several conditions. One condition per rule stays free. The link is hidden when the Pro add-on is active.
1.3.0
- Developer: added extension hooks (jcpm_rule_matches, jcpm_save_rule, jcpm_rule_row_extra, jcpm_settings_enqueue) and a public Rules::condition_matches() so add-ons can extend the rule engine. No change to how the plugin behaves on its own.
1.2.1
- Cleaner rule layout — reads When Is Value Hide this method — and a nicer on/off toggle for “exclude shipping”.
1.2.0
- A rule can now target several payment methods at once (searchable multi-select), instead of one method per rule.
1.1.0
- New conditions: shipping country, customer role, and cart contents (digital vs physical).
- “Cart total” can now compare with or without shipping (excl. shipping checkbox).
1.0.0
- First release. Rule table: hide a payment method by cart total or item count, less/greater than a value.
