=== FlexiCOD – Cash on Delivery Controls for WooCommerce ===
Contributors: gamaup
Tags: woocommerce, cash on delivery, cod, payment, checkout
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: woocommerce
WC requires at least: 8.0
WC tested up to: 11.1
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Control when WooCommerce Cash on Delivery is offered — restrict it by location, cart, and customer, and charge an extra COD fee when it applies.

== Description ==

FlexiCOD extends the built-in WooCommerce **Cash on Delivery (COD)** payment gateway. It does not replace the core `cod` gateway — it wraps and conditions it, so it stays compatible with any theme, checkout flow, or integration that already recognises WooCommerce's COD gateway.

Use it to decide exactly when COD should appear at checkout and to charge an extra fee when it does.

**Features**

* Set an availability rule that decides when COD is offered.
* Restrict by location, by customer (roles and guest checkout), and by cart contents — the products, categories, and shipping classes it contains.
* Add an extra COD fee, fixed or percentage, with your own label and optional tax — shown at checkout, and optionally on the cart page too.
* Show a custom message explaining why COD is unavailable when a customer doesn't qualify.
* First-class support for **HPOS** (High-Performance Order Storage) and **Checkout Blocks**.

All settings live on WooCommerce's own Cash on Delivery settings page (WooCommerce → Settings → Payments → Cash on delivery) — there is no extra menu to hunt for.

**FlexiCOD Pro**

Need finer control? [FlexiCOD Pro](https://getflexicod.com/?utm_source=wporg&utm_medium=readme&utm_campaign=description#pricing) adds the full Cash on Delivery toolkit:

* **Unlimited availability rule groups** — combine different sets of conditions, each with its own COD fee.
* **More cart conditions** — cart amount, weight, item count, applied coupons, and stock status.
* **Customer history conditions** — offer COD based on a customer's previous orders and total spent.
* **Deny rules** — block COD outright for specific customers, locations, or carts, no matter which availability rule matches.
* **Partial COD** — collect a deposit online at checkout and the remaining balance in cash on delivery.
* **COD fee caps** — set a minimum and maximum for percentage-based fees.
* **Priority support**.

Every purchase is covered by a 7-day money-back guarantee.

== Installation ==

1. Upload the plugin to the `/wp-content/plugins/` directory, or install it through the Plugins screen in WordPress.
2. Activate the plugin through the Plugins screen.
3. Go to WooCommerce → Settings → Payments → Cash on delivery to configure it.

== Frequently Asked Questions ==

= Does this replace WooCommerce's Cash on Delivery gateway? =

No. It wraps the core `cod` gateway and conditions its availability and fee, so everything that already works with WooCommerce COD keeps working.

= Where do I configure it? =

On WooCommerce's own Cash on Delivery settings page: WooCommerce → Settings → Payments → Cash on delivery. The plugin adds its options there instead of creating a separate settings page.

= Is it compatible with HPOS and the block-based checkout? =

Yes. The plugin declares compatibility with High-Performance Order Storage and works with both the classic checkout and the Checkout Blocks.

= Can I charge an extra fee for paying by Cash on Delivery? =

Yes. You can add a fixed or percentage fee to your availability rule, give it your own label, mark it taxable, and choose whether it also shows on the cart page.

== Screenshots ==

1. Restrict COD by Location

2. Restrict COD by Cart contents

3. Restrict COD by customer

4. Set an extra fee

5. Show COD unavailable message

6. Extra fee applied

== Changelog ==

= 1.1.0 =
* New: Introducing FlexiCOD Pro — unlimited availability rule groups, more cart and customer conditions, deny rules, Partial COD deposits, and COD fee caps.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.1.0 =
Introduces FlexiCOD Pro and previews its features on the Cash on Delivery settings page.

= 1.0.0 =
Initial release.
