=== VSW COD Handling Charges ===
Contributors:      vaibhavsweb
Tags:              cod charges, handling charges, COD, Cod Deposit, COD
Requires at least: 5.8
Tested up to:      7.0
Stable tag:        1.0.0
Requires PHP:      7.4
License:           GPLv2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html

Add a configurable handling/convenience fee to WooCommerce orders when customers choose Cash on Delivery. Fee disappears for all other payment methods.

== Description ==

**VSW COD Handling Charges** lets WooCommerce store owners add an extra handling or convenience fee that appears at checkout *only* when the customer selects **Cash on Delivery (COD)** as their payment method. The moment they switch to any other method (UPI, credit card, net banking, etc.) the fee is removed automatically — with zero page reload.

This is ideal for Indian e-commerce stores and any store worldwide that wants to recover the operational cost of processing cash payments.

= How It Works =

1. Customer adds items to the cart.
2. Customer proceeds to checkout and selects **Cash on Delivery**.
3. A handling fee (e.g. ₹56) is automatically added to the order total.
4. If the customer switches to any other payment method, the fee is removed instantly.
5. The fee label, amount, and type are all editable from the WordPress admin.

= Key Features =

* ✅ **Enable / Disable** — turn the fee on or off without deactivating the plugin.
* 💵 **Fixed or Percentage** — charge a flat amount (e.g. ₹56) or a percentage of the cart subtotal (e.g. 5%).
* 🏷 **Custom Fee Label** — set exactly what customers see (e.g. "COD Handling Charges", "Convenience Fee", etc.).
* ⚡ **Real-Time Update** — fee adds and removes as the customer toggles payment methods; no page reload.
* 🧾 **Optional Tax** — choose whether tax should apply to the handling charge.
* 🎨 **Clean Admin UI** — settings page under **WooCommerce → COD Handling Charges** with a modern design.
* 🔗 **Quick Settings Link** — accessible directly from the Plugins list page.
* 🔌 **HPOS Compatible** — fully compatible with WooCommerce High-Performance Order Storage.
* 🌐 **Translation Ready** — all strings are properly internationalised.

= Example Scenario =

> Cart subtotal: ₹500
> Shipping: ₹60
> COD Handling Charges: ₹56 ← added only when COD is selected
> **Order Total (COD): ₹616**
>
> Switch to UPI → COD Handling Charges removed
> **Order Total (UPI): ₹560**

= Who Is This For? =

* Indian e-commerce stores wanting to recover COD processing costs.
* Any WooCommerce store worldwide charging a convenience fee for cash payments.
* Store owners who want full control over when and how much the fee is.

= Privacy Policy =

This plugin does not collect, store, or transmit any personal data. It does not use cookies or connect to any external service.

== Installation ==

= Automatic Installation (Recommended) =

1. Log in to your WordPress admin panel.
2. Go to **Plugins → Add New**.
3. Search for **VSW COD Handling Charges**.
4. Click **Install Now**, then **Activate**.
5. Go to **WooCommerce → COD Handling Charges** to configure.

= Manual Installation =

1. Download the plugin ZIP file.
2. Go to **Plugins → Add New → Upload Plugin**.
3. Select the ZIP file and click **Install Now**.
4. Click **Activate Plugin**.
5. Go to **WooCommerce → COD Handling Charges** to configure.

= FTP Installation =

1. Upload the `vsw-cod-handling-charges` folder to `/wp-content/plugins/`.
2. Activate the plugin through **Plugins → Installed Plugins**.
3. Go to **WooCommerce → COD Handling Charges** to configure.

== Frequently Asked Questions ==

= Does the fee show for all payment methods? =

No. The fee is added **only** when the customer selects Cash on Delivery. It is removed automatically when any other payment method is selected.

= Can I use a percentage instead of a fixed amount? =

Yes. In the settings, switch the **Charge Type** to **Percentage of Cart Subtotal** and enter a value like `5` for 5%.

= What does the fee appear as in the customer's order? =

The fee is shown with the label you set in **Fee Label** (default: "COD Handling Charges"). It appears as a separate line in the cart and checkout totals, below shipping.

= Will the fee appear on the order confirmation and invoice? =

Yes. Since WooCommerce records the fee as part of the order, it will appear in all order screens, emails, and invoices.

= Does it work with HPOS (High-Performance Order Storage)? =

Yes, full compatibility with WooCommerce HPOS is declared.

= Is the plugin translation-ready? =

Yes. All strings use the `vsw-cod-handling-charges` text domain and can be translated using standard `.po`/`.mo` files or plugins like Loco Translate.

= Does the plugin work on the Cart page as well? =

Yes. The fee is calculated whenever WooCommerce recalculates cart totals. If the user is on the cart page and COD is the active method (from a previous session), the fee will appear there too.

= Do I need to configure anything after activation? =

The plugin ships with a default ₹56 fixed charge ready to use. Simply activate, verify the amount, and you're good to go.

== Screenshots ==

1. The settings page under WooCommerce with Enable toggle, Fee Label, Charge Type, Amount and Tax options.
2. COD Handling Charges added to the cart total at checkout when Cash on Delivery is selected.
3. Fee removed from cart total when the customer switches to an online payment method.

== Changelog ==

= 1.0.0 — 2024-04-01 =
* Initial release.
* Fixed and percentage charge type support.
* Real-time fee update on payment method change via WooCommerce AJAX.
* HPOS (High-Performance Order Storage) compatibility declared.
* Full translation support with text domain `vsw-cod-handling-charges`.

== Upgrade Notice ==

= 1.0.0 =
Initial release. No upgrade steps required.
