=== Extnify Fee Rules for WooCommerce ===
Contributors: extnify
Tags: fees, surcharge, checkout, discount, woocommerce
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.1
Requires Plugins: woocommerce
WC requires at least: 7.1.0
WC tested up to: 11.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add conditional fees or discounts to the WooCommerce cart and checkout — flat or percentage, gated by zone, payment or shipping method.

== Description ==

**Extnify Fee Rules** lets you add your own fees — or discounts — to the WooCommerce cart and checkout, and applies them **automatically** when the cart matches. There's no code for the customer to type: a matching fee simply appears on the totals.

Create as many fees as you need, set each one as a flat amount or a percentage of the subtotal, and limit when it applies by shipping zone, payment method and shipping method. A positive amount adds a fee; a negative amount shows as a discount. Everything is managed from one simple screen, and a built-in live log shows you exactly why a fee did or didn't apply.

[Read the documentation »](https://extnify.com/docs/woocommerce/extnify-fee-rules-woocommerce) | [Try the live demo »](https://wc-dev.extnify.com/?auto_login=extnify-fee)

**See it in action:**

https://www.youtube.com/watch?v=mI1q1SQ3plY

= What you can do with Extnify Fee Rules =

* Charge a **processing, handling or service fee** on every order.
* Add a **surcharge** only for Cash on Delivery (or any chosen payment method).
* Apply a fee **only in a certain shipping zone** — or only with a certain shipping method.
* Give an **automatic discount** by entering a negative amount — no coupon code needed.
* Charge a **flat amount** ($5) or a **percentage of the subtotal** (10%).
* Run **several fees at once** — each one checks its own rules independently.

= Add fees or discounts =

One form creates both. Enter `5` for a $5 fee, or `-5` for a $5 discount. Enter `10%` for ten percent of the subtotal, or `-10%` to take ten percent off. A positive amount is added to the totals as a fee; a negative amount shows as a reduction. Every matching fee applies on its own — the customer doesn't choose anything.

= Conditional rules =

Each fee only applies when the cart matches the rules you set, combined with **AND**. Leave any rule at "For any" to ignore it. The free version gates fees by:

* **Shipping zone** — the WooCommerce zone the destination falls in.
* **Payment method** — the gateway the customer chose at checkout.
* **Shipping method** — the shipping option chosen (if you also run Extnify Shipping Rules, its methods are listed here individually).

= Flat or percentage amounts =

Set a fixed value, or add a trailing `%` to make it a percentage of the cart subtotal. No currency sign needed — just the number. Tiered (range-based) amounts and extra percentage bases are available in Pro.

= Tax handling =

Pick a tax class per fee, or set it to **None** for a non-taxable fee. Fee tax follows your WooCommerce tax settings.

= Easy management =

Create, enable, disable, copy, delete and bulk-save all your fees from one screen, and set the order they're applied in. New fees appear in the sidebar instantly and are written to the database when you save.

= Live debugging =

When a fee doesn't show up and you're not sure why, turn on the built-in debug log. For each fee it reports whether its rules passed or failed, the resolved amount, and whether it was applied or skipped — so you can see exactly which rule filtered it out. The log is stored in your own database (never a file, never sent anywhere) and can be cleared with one click.

= Works everywhere WooCommerce does =

Fees are applied server-side through WooCommerce's standard fee system, so the totals are correct on both the **classic** and the **block** cart and checkout.

= Built for speed and privacy =

* **No external requests and no tracking** — every rule and calculation runs on your own store.
* **Lightweight** — no bloat, no third-party libraries pulled in on your storefront.
* **Translation-ready** — ships with a `.pot` file and a clean `extnify-fee` text domain.
* **Clean uninstall** — deleting the plugin removes its table, option and log; nothing is left behind.

= Need more? Extnify Fee Rules Pro =

[Extnify Fee Rules Pro](https://extnify.com/products/extnify-fee-rules-pro) adds:

* Product, category and brand targeting, plus date/time, location, coupon and customer conditions.
* Tiered (range-based) amounts with min/max caps.
* More percentage bases (grand total, weight, quantity and more).
* Fee grouping and tax-inclusive fees.
* CSV import/export.

Your free fees carry over automatically — Pro shares the same data.

= More plugins by Extnify =

* **Extnify Shipping Rules** — build your own conditional WooCommerce shipping methods and rates.
* **Extnify Offer Rules** — let customers pick selectable discounts or add-ons at checkout.

Extnify Fee Rules is built by Extnify, the team behind the X-FeePro extension for OpenCart.

== Installation ==

1. Make sure WooCommerce is installed and active.
2. Upload the plugin to `/wp-content/plugins/`, or install it from **Plugins → Add New → Upload Plugin**.
3. Activate the plugin through the **Plugins** menu in WordPress.
4. Go to **WooCommerce → Extnify Fee Rules** and set **Module Status = Enabled** in Global Settings.
5. Click **Add New Method**, enter a fee amount, and (optionally) restrict it by shipping zone, payment method or shipping method. Save, and it appears on the cart and checkout totals automatically.

== Frequently Asked Questions ==

= My fee doesn't appear on the cart or checkout. =

Make sure **Module Status** is Enabled in Global Settings and the fee's own **Status** is Enabled. Then open the live debug log (Global Settings → Help & Support) and recalculate on the cart — it shows which rule failed, or whether the amount resolved to 0.

= How do I add a discount instead of a fee? =

Enter a negative amount, for example `-5` or `-10%`. WooCommerce shows it as a discount line on the totals.

= Can I charge a percentage? =

Yes. Add a trailing `%` (for example `10%`, or `-10%` for a discount). It's calculated from the cart subtotal. Tiered range-based amounts are a Pro feature.

= Can I apply a fee only for Cash on Delivery? =

Yes. Set the fee amount, then set **Payment Method** on the Generic Rules tab to Cash on Delivery. The fee is evaluated once a payment method is chosen.

= Does it work with the WooCommerce block checkout? =

Yes. Fees are applied server-side, so the totals are correct on both the classic and block cart and checkout.

= Does this send any data anywhere? =

No. Extnify Fee Rules makes no external requests and collects no data — everything runs on your store.

= Can I upgrade to Pro without losing my settings? =

Yes. Extnify Fee Rules and Extnify Fee Rules Pro share the same data, so your configured fees carry over automatically.

== Screenshots ==

1. Global settings and your list of fees.
2. Creating a fee — general settings and its conditional rules (shipping zone, payment method, shipping method).
3. Price Setting — enter the fee amount as a flat value or a percentage.
4. Your fees shown on the cart and checkout totals.
5. Built-in Help & Support with the live debug log.

== Changelog ==

= 1.0.1 =
* Expanded the plugin listing (features, demo, FAQ).
* Corrected the in-admin Documentation link.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.1 =
Refreshed the plugin listing and corrected the in-admin Documentation link.

= 1.0.0 =
Initial release.
