=== Kuwadema – Kuwait Delivery Areas for WooCommerce ===
Contributors: softx
Tags: delivery, delivery-fee, kuwait, checkout, woocommerce
Requires at least: 5.8
Tested up to: 7.0
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

Area-based delivery fees for WooCommerce. Bilingual (AR/EN), classic and block checkout, free-delivery thresholds.

== Description ==

Kuwadema adds an area-based delivery fee system to WooCommerce. Define your delivery cities and areas, set a price per area, and customers pick their area at checkout — the delivery fee is added to the cart automatically.

Built for stores in Kuwait (ships with a one-click default dataset of Kuwait governorates and 80+ areas), but works for any country: add your own cities and areas under any billing country.

This plugin requires WooCommerce. It is an independent extension and is not affiliated with or endorsed by WooCommerce or Automattic.

= Features =

* **Cities & areas manager** — add, edit, sort, and toggle delivery cities and areas from a dedicated admin screen with inline editing.
* **Per-area delivery fees** — each area has its own delivery price.
* **Free-delivery threshold** — set a minimum order per area; carts at or above it get free delivery, with a clear "Free (orders over X)" label.
* **Minimum order floor** — optionally require a minimum cart total before an area can be selected.
* **Classic + block checkout** — a searchable area picker on the classic checkout and native support for the WooCommerce Cart & Checkout Blocks (Additional Checkout Fields API).
* **Bilingual (Arabic / English)** — every city and area stores both names; the checkout shows the right one for the active language. WPML and Polylang compatible.
* **Field layout control** — reorder, show/hide, and set required/width for checkout billing fields from a drag-and-drop settings card, including Kuwait-specific address fields (Block, Jaddah, House No., Floor, Civil ID) with per-country visibility.
* **Delivery notes** — per-area notes stored in both languages.
* **CSV export** — download all cities, areas, and prices as a UTF-8 CSV backup.
* **Multi-currency compatible** — converts the fee for Curcy (WooCommerce Multi Currency), WOOCS, WPML/WCML, and Aelia Currency Switcher.
* **HPOS compatible** — order meta is written through the WooCommerce CRUD API and works with High-Performance Order Storage.
* **Cache-safe checkout** — emits no-cache signals (WP Super Cache, W3TC, LiteSpeed, Autoptimize) so delivery fees never render from a stale cached page.
* **Data-preserving by default** — deleting the plugin keeps your data unless you explicitly opt in to a wipe via a wp-config.php constant.

== Installation ==

1. Upload the plugin ZIP via Plugins → Add New → Upload Plugin, or unzip it into `/wp-content/plugins/`.
2. Activate the plugin through the Plugins screen.
3. Make sure WooCommerce is active (required for checkout integration).
4. Go to **Delivery Manager → Import** and click **Load default Kuwait dataset**, or add your own cities and areas under **Delivery Manager → Cities / Areas**.
5. Prices and the area picker appear on your checkout immediately.

== Frequently Asked Questions ==

= Does it work outside Kuwait? =

Yes. Kuwait is just the default dataset. You can add cities and areas under any billing country from Delivery Manager → Cities, and choose which countries see the area picker under Settings → Delivery Countries.

= Does it support the WooCommerce block checkout? =

Yes. The area picker is registered through the WooCommerce Additional Checkout Fields API (WooCommerce 8.9+) and the delivery fee is applied to block-checkout carts as well.

= What about minimum order amounts? =

Each area has a free-delivery threshold: carts at or above it get free delivery. Set it to 0 to always charge the delivery fee. A separate optional "required minimum order" field blocks checkout below a hard floor.

= Will I lose my data when updating or deleting the plugin? =

No. Updating never touches your data. Deleting the plugin also preserves all data by default — a full wipe only happens if you add `define( 'KUWADEMA_DROP_DATA_ON_UNINSTALL', true );` to wp-config.php before deleting.

= Is it compatible with multi-currency plugins? =

Yes — Curcy (WooCommerce Multi Currency), WOOCS, WPML/WCML, and Aelia Currency Switcher are converted automatically. WooCommerce Payments multi-currency is handled natively.

== Screenshots ==

1. Delivery areas manager with inline editing.
2. Cities manager.
3. Checkout area picker with live delivery fee.
4. Settings — field layout and delivery countries.

== Changelog ==

= 1.0.0 =
* Initial release on WordPress.org.
* Cities & areas manager with per-area delivery fees and free-delivery thresholds.
* Classic and block checkout integration with a searchable, bilingual area picker.
* Field layout control for checkout billing fields with per-country visibility.
* CSV export and one-click default Kuwait dataset.
* Multi-currency and HPOS compatibility.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
