=== COD RuleKit for WooCommerce ===
Contributors: codshield
Tags: woocommerce, cash on delivery, cod, checkout, payment gateway
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Control WooCommerce Cash on Delivery with order limits, country, shipping, category rules, and optional COD fees.

== Description ==

COD RuleKit for WooCommerce gives store owners focused control over when the built-in WooCommerce Cash on Delivery (COD) payment method is available.

Use it to restrict COD by order value, destination, shipping method, or product category. You can also add a fixed or percentage-based fee when a customer chooses COD.

= Features =

* Enable or disable all COD RuleKit rules from one switch.
* Set a minimum order amount for COD.
* Set a maximum order amount for COD.
* Allow COD only for selected countries.
* Allow COD only with selected shipping methods.
* Block COD when the cart contains products from selected categories or their child categories.
* Add a fixed COD fee.
* Add a percentage COD fee.
* Customize the COD fee label.
* Compatible with WooCommerce High-Performance Order Storage (HPOS).
* Declares compatibility with WooCommerce Cart and Checkout Blocks.

Empty restriction fields mean that rule does not restrict COD.

= How it works =

The plugin controls the built-in WooCommerce Cash on Delivery gateway. It does not create a separate payment gateway.

When WooCommerce builds the list of payment methods available at checkout, COD RuleKit evaluates the configured rules. If any active rule fails, COD is removed from the available payment methods for that checkout.

If a COD fee is configured, the fee is added only when Cash on Delivery is the selected payment method and the configured COD rules pass.

== Installation ==

1. Install and activate WooCommerce.
2. Make sure Cash on Delivery is enabled under WooCommerce > Settings > Payments.
3. Upload the COD RuleKit ZIP through Plugins > Add Plugin > Upload Plugin, or install it from the WordPress Plugin Directory when available.
4. Activate COD RuleKit for WooCommerce.
5. Go to WooCommerce > COD RuleKit.
6. Configure the rules you need and click Save COD settings.

== Screenshots ==

1. COD RuleKit settings page with the master enable switch and COD controls.
2. Order amount rules for minimum and maximum COD order values.
3. Availability rules for countries, shipping methods, and blocked product categories.
4. COD fee settings with fixed and percentage fee options.

== Frequently Asked Questions ==

= Does this plugin replace WooCommerce Cash on Delivery? =

No. It controls the built-in WooCommerce Cash on Delivery gateway. COD must still be enabled in WooCommerce payment settings.

= What happens when no countries are selected? =

COD is not restricted by country.

= What happens when no shipping methods are selected? =

COD is not restricted by shipping method.

= What happens when no product categories are selected? =

COD is not restricted by product category.

= How are minimum and maximum order amounts calculated? =

The rules use the WooCommerce cart items total after discounts and before shipping.

= How is the percentage COD fee calculated? =

The percentage fee is calculated from the cart items total after discounts plus shipping, before the COD fee itself is added.

= Is the COD fee taxable? =

Version 1.0.0 adds the COD fee as non-taxable.

= Does the plugin send store or customer data to an external service? =

No. Version 1.0.0 makes no external API requests and includes no analytics or tracking service.

= What data does the plugin store? =

The plugin stores only its configuration in the WordPress options table. Uninstalling the plugin removes that configuration.

== Privacy ==

COD RuleKit for WooCommerce does not transmit store, customer, order, or usage data to an external service. The plugin stores its settings locally in the WordPress database.

== Changelog ==

= 1.0.0 =
* Initial public release.
* Added minimum and maximum COD order rules.
* Added country, shipping method, and product category rules.
* Added fixed and percentage COD fees.
* Added HPOS and Cart/Checkout Blocks compatibility declarations.
