=== Tadrik Checkout Rules – Hide Payment & Shipping Methods for WooCommerce ===
Contributors: tadrik
Tags: payment methods, shipping methods, minimum order, cash on delivery, conditional payments
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Hide payment and shipping methods by cart total, country, role or product. Disable cash on delivery. Set a minimum or maximum order.

== Description ==

Tadrik Checkout Rules lets you hide payment methods and shipping methods in WooCommerce by cart total, country, postcode, customer role or product, and set a minimum or maximum order. Disable cash on delivery for large orders, or offer bank transfer only to trade customers.

Some orders shouldn't be paid by cash on delivery. Some customers should only see bank transfer. When free shipping is on offer, the paid options shouldn't be. And a $12 order shouldn't get through at all. WooCommerce has nowhere to write these rules down.

Tadrik Checkout Rules gives you that place. Each rule reads as a sentence: "Hide Cash on delivery when the cart total is at least $300." Add it under WooCommerce > Checkout Rules, and every checkout follows it, the block checkout and the classic one.

**What it does**

* **Hide payment methods, or offer only some**, by cart total, number of items, cart weight, products, categories, shipping classes, coupon, customer role (guests included), country or state, and the shipping method the customer picked.
* **Hide shipping methods, or offer only some.** For example, hide the paid options whenever free shipping is on offer, or hide free shipping when the cart holds a bulky item.
* **Stop an order with your own message**: a minimum order ("Add $12.50 more to check out"), a maximum, or any order you can't take.
* **Test a cart** before you switch a rule on: pick a customer, an address and some products, and see which methods they'd be offered and which rule hid the others.
* Unlimited rules, starter rules for the common cases, an on/off switch per rule, and a list of recent orders your rules changed.
* Customer role, category, shipping class and coupon conditions are all included.

**Safe by design**

* If your rules would leave a customer with no way to pay or no way to ship, the plugin shows every method instead and warns you, so a mistake in a rule never stops your sales.
* If anything goes wrong inside the plugin, your checkout works exactly as it would without it.
* A customer can't pick a hidden method by editing the page: WooCommerce refuses it.

**Everything is free while we launch**

Every feature below is free, on as many sites as you like, with no account and no card:

* Rename shipping methods for some customers, for example "Trade delivery, 2–3 days".
* Quantity rules: sell in packs of 6, or set a minimum or maximum per product or category.
* More conditions: postcode or ZIP (with wildcards and ranges), the customer's past orders (for example, no cash on delivery on a first order), email or email domain, and day and time.
* Import and export your rules.

We'd rather have people using it first. Paid plans for larger shops may come later; if they do, early users keep what they have. Details: https://tadrik.com/checkout-rules/

Made by Tadrik, the small-tools company behind Tadrik Inbox. Questions: hello@tadrik.com.

== Installation ==

1. Make sure WooCommerce is installed and active.
2. Under Plugins > Add New, search for "Tadrik Checkout Rules", then install and activate it. Or upload the zip under Plugins > Add New > Upload Plugin.
3. Open WooCommerce > Checkout Rules. Start from one of the common rules, or write your own.
4. Check it on the Test a cart tab, then switch it on.

== Frequently Asked Questions ==

= How do I disable cash on delivery for some customers? =

Add a rule that hides Cash on delivery when the cart total is at least an amount you choose, for some countries or postcodes, for a customer role, or for customers with no past orders.

= How do I hide other shipping methods when free shipping is available? =

Add a shipping rule that hides the paid shipping methods whenever free shipping is on offer. Local pickup can stay if you leave it out of the rule.

= How do I show a payment method only to wholesale customers? =

Hide it for everyone else: for example, a rule that hides Bank transfer when the customer is a guest or has the Customer role. Your wholesale role keeps it.

= Does it work with the block checkout? =

Yes. Rules apply the same way to the block checkout and to a classic checkout page. The payment and shipping lists update when the customer changes their address or shipping method.

= How do I set a minimum order amount? =

Add a rule with "Stop the order with a message" and the condition "Cart total is less than 50". The message can say how much is missing: "Orders start at {threshold}. Add {missing} more to check out." Or start from the "A minimum order" rule, which is set up this way.

= My rule doesn't seem to work. How do I check it? =

Open the Test a cart tab, build a cart like your customer's and press Show me. You'll see every payment and shipping method, which rule hid each one, and why ("cart total $320.00 is at least $300"). If it still looks wrong, email hello@tadrik.com with a screenshot of that screen.

= What if my rules hide every payment method? =

The plugin shows them all instead, so the customer can still pay, and puts a warning on the Checkout Rules page with the date and the rules involved. To refuse an order on purpose, use "Stop the order with a message".

= Can a customer still choose a hidden method? =

No. WooCommerce only accepts the methods on offer for that cart, on both checkouts.

= Which customer roles can I use? =

Every role on your site, plus "guest" for customers who aren't logged in. Wholesale plugins that use roles, such as Wholesale Suite, WooCommerce Wholesale Pro and Addify, work as they are. B2BKing customer groups aren't roles and aren't supported yet.

= How is the cart total worked out? =

Products after coupons, before shipping and fees. It includes tax if your store shows cart prices with tax (WooCommerce > Settings > Tax).

= Does hiding a payment method hide its Apple Pay or Google Pay button? =

Not always. Those buttons on product and cart pages come from your payment plugin, and some don't follow the checkout's list. If you hide a card payment method, check its express buttons too.

= Does it apply to the "Pay for order" page or to orders I create in the admin? =

No. Rules apply when a customer checks out their own cart.

= Can it add a fee or a discount for a payment method? =

No. The plugin hides, shows and renames methods and can stop an order. It never changes prices or adds fees.

= Does it slow down my checkout? =

Rules run in memory against the cart WooCommerce has already loaded. They add no page requests and no calls to outside services.

= What happens if I deactivate or delete it? =

Deactivate it, and your checkout shows every method again; your rules are kept. Delete it, and the rules and the plugin's settings are removed. Your orders aren't touched.

= Is it really free? =

Yes. Every feature is free while we launch, on any number of sites. Paid plans for larger shops may come later; if they do, early users keep what they have.

== Screenshots ==

1. All your checkout rules in one table, each written as a sentence.
2. Adding a rule: what should happen, and when. The sentence at the top changes as you type.
3. Test a cart: what a customer would be offered, and which rule hid the rest.
4. At the checkout, the customer sees your message, and the order can't go through until the cart qualifies.

== External services ==

The plugin runs entirely on your store and sends no data anywhere while you use it. The one exception is optional: when you deactivate it, the Plugins screen asks why. Only if you click "Send & deactivate" does it send your chosen reason, your optional note (up to 500 characters) and the plugin, WordPress, WooCommerce and PHP versions to Tadrik's feedback service at ops.tadrik.com. It never sends your site address, your email address or any other personal data, and "Skip & deactivate" sends nothing. Privacy: https://tadrik.com/privacy.html.

== Privacy ==

The Plugins screen shows a short question when you deactivate this plugin: why are you deactivating? It is optional. Only if you click "Send & deactivate" does the plugin send your chosen reason, your optional note (up to 500 characters) and the plugin, WordPress, WooCommerce and PHP versions to Tadrik's feedback service at ops.tadrik.com. It never sends your site address, your email address or any other personal data, and "Skip & deactivate" sends nothing. Privacy: https://tadrik.com/privacy.html.

== Changelog ==

= 1.0.1 =
* One dismissible request for a review on the Checkout Rules page, shown only after your rules have changed a real order.
* An optional question when you deactivate the plugin. Nothing is sent unless you click "Send & deactivate".

= 1.0.0 =
* First version: payment and shipping method rules, stop-the-order messages, Test a cart, starter rules, and a list of recent orders your rules changed.
