=== Shaban COD Limits ===
Contributors: sitebyshaban
Tags: woocommerce, cash on delivery, cod, payment gateways, checkout
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Hide Cash on delivery above an order value you choose, for the whole store or only for selected products and categories.

== Description ==

Shaban COD Limits lets you stop Cash on delivery (COD) on high-value orders, without touching code. Everything is managed from one dashboard under **WooCommerce > COD Limits**, so a shop owner can change the rule on their own.

**What you can set**

* **Limit amount:** hide the payment method when the order value is "above" or "at or above" your amount. There is no preset amount: nothing is restricted until you enter your own and save.
* **How the value is counted:** the cart total (with shipping, tax and fees) or products only (after discounts).
* **Where it applies:** the whole store, only selected products or categories, or everything except selected products or categories.
* **Which payment methods are hidden:** Cash on delivery by default. Any other WooCommerce payment method can be added, which helps with custom COD plugins.
* **Customer message:** an editable message on the checkout page, with `{limit}` replaced by the amount.
* **Order tester:** type an order value on the settings page and see straight away whether COD would be shown.
* **Built-in support form:** if something is not working, send a message to the developer from the bottom of the settings page.

**How it works**

The plugin removes the chosen payment methods from the list WooCommerce offers to the customer. Because the method is removed from the list itself, WooCommerce also refuses it on the server if someone tries to submit it anyway.

**Compatible with**

* WooCommerce High-Performance Order Storage (HPOS).
* The classic and the block-based checkout. The payment method is hidden in both. The explanatory message is shown on the classic checkout and the pay-for-order page.

**Privacy**

The plugin does not collect or send any data on its own, does not set cookies and makes no external requests. It stores its settings in one option in your database.

The only time anything leaves your site is when an administrator fills in the Support form at the bottom of the settings page and clicks "Send message". The name, email address and message they typed (plus technical details, only if they tick the box) are emailed to the plugin developer through your site's normal email system. A short-lived marker is kept for one minute to stop double sending.

== Installation ==

1. Upload the `shaban-cod-limits` folder to `/wp-content/plugins/`, or install the ZIP from Plugins > Add New > Upload Plugin.
2. Activate the plugin. WooCommerce must be active.
3. Go to WooCommerce > COD Limits and set your rule.

== Frequently Asked Questions ==

= Can I hide COD only for certain products? =

Yes. Under "Applies to" choose "Selected products", then pick products and/or categories. Set the amount to 0 to hide COD whenever one of those products is in the cart.

= Is "above 5000" the same as "5000 and over"? =

No. "Above" hides COD only when the value is greater than the limit, so exactly 5000 still allows COD. Choose "at or above" to hide it at 5000 too.

= Why is nothing hidden after I activate the plugin? =

The plugin has no preset limit. Open WooCommerce > COD Limits, enter your own amount and save. Until then, payment methods are not restricted.

= How do I get support? =

Use the "Need help?" form at the bottom of WooCommerce > COD Limits (or the Support link on the Plugins screen). It emails the developer, who replies to the address you enter. You can also use the plugin's support forum on WordPress.org.

= Can I hide payment methods other than COD? =

Yes. Under "Payment methods to hide" you can tick any payment method WooCommerce lists.

= Does it work with multi-currency plugins? =

The limit is compared with the cart values as WooCommerce calculates them for the customer. If a multi-currency plugin converts prices, set the limit in the currency your customers see.

= Does it work with the block checkout? =

Yes, the payment method is hidden. The custom message is only shown on the classic checkout and the pay-for-order page.

= Can I add my own conditions? =

Yes. Use the `shaban_cod_limits_is_blocked` filter. It receives the result, the plugin settings and the normalised cart data.

== Screenshots ==

1. The rule, written as a sentence, with the cart total / products only switch.
2. Choosing selected products and categories.
3. The summary and the "Try an order" tester.

== Changelog ==

= 1.0.0 =
* First release.

== Upgrade Notice ==

= 1.0.0 =
First release.
