=== Custom Shipping by Weight PRO ===
Contributors:       yourname
Tags:               woocommerce, shipping, weight, shipping zones, delivery
Requires at least:  5.8
Tested up to:       6.5
Requires PHP:       7.4
WC requires at least: 7.0
WC tested up to:    9.0
Stable tag:         1.1.0
License:            GPL-2.0-or-later
License URI:        https://www.gnu.org/licenses/gpl-2.0.html

A WooCommerce shipping method that calculates rates based on cart weight with
dynamic price tiers, conditional discounts, and estimated delivery dates.

== Description ==

**Custom Shipping by Weight PRO** is a powerful WooCommerce shipping method that
lets you define unlimited weight-based price tiers per shipping zone instance.

= Features =

* **Unlimited weight tiers** — define as many min/max weight ranges and prices as needed.
* **Conditional discounts** — automatically reduce or waive the shipping cost when a minimum cart weight or order total is reached.
* **Free shipping label** — display a custom green badge instead of a zero price.
* **Estimated delivery date** — show the expected delivery date (calculated in business days) at checkout.
* **Short description** — add a line of text below the method title (e.g. "5–6 business days").
* **Product page estimate** — display a shipping cost estimate on the single product page.
* **Per-kg surcharge** — automatically add an extra amount per kg when the cart exceeds the last tier.
* **HPOS compatible** — fully compatible with WooCommerce High-Performance Order Storage.
* **Multi-instance** — use the method in multiple shipping zones with independent settings.
* **Translation-ready** — all strings are internationalised.

= How it works =

1. Go to **WooCommerce → Settings → Shipping**.
2. Open a shipping zone (or create one).
3. Click **Add shipping method** and choose **Shipping by Weight PRO**.
4. Click **Edit** to open the settings:
   - Set a method title and optional description.
   - Add weight tiers with the interactive table.
   - Configure a conditional discount if needed.
   - Set the estimated delivery time in business days.
5. Save. The method will now appear on cart and checkout for orders matching that zone.

= Display example =

    ◉  Express Delivery                     9.90 €
       Estimated delivery: 13/05/2026
       2–3 business days

    ◉  Standard Shipping                      Free
       Estimated delivery: 18/05/2026
       5–6 business days

== Installation ==

1. Upload the `cswp` folder to `/wp-content/plugins/`, or install via
   **Plugins → Add New → Upload Plugin**.
2. Activate the plugin from **Plugins → Installed Plugins**.
3. Navigate to **WooCommerce → Settings → Shipping** and configure a zone.

== Frequently Asked Questions ==

= Can I use multiple instances in different zones? =

Yes. Each shipping zone can have its own instance with completely independent
tier settings, discounts, and labels.

= What happens when the cart weight exceeds all tiers? =

The last tier's price is used as the base, and a configurable per-kg surcharge
is added for each kilogram (rounded up) above the last tier's maximum.

= Does it support taxes? =

Yes. Each instance has a **Tax status** field (Taxable / None) that integrates
with WooCommerce's standard tax calculation.

= Will it work with WooCommerce blocks (checkout block)? =

The plugin is compatible with the classic cart and checkout templates.
Block-based checkout support is on the roadmap.

= How do I remove all plugin data on deletion? =

All plugin data (tiers and settings) is automatically removed when you delete
the plugin via **Plugins → Installed Plugins → Delete**.

== Changelog ==

= 1.1.0 =
* Added: Free shipping label field (custom text shown in green when cost is zero).
* Added: Estimated delivery date displayed in business days.
* Added: Short description field shown below the method title at checkout.
* Added: WooCommerce HPOS compatibility declaration.
* Added: Activation check for minimum PHP and WooCommerce versions.
* Added: Settings link on the Plugins screen.
* Improved: Settings are now read directly from the database, bypassing
  WooCommerce session cache (fixes stale label data).
* Improved: Inline styles removed from product page estimate; CSS classes used.
* Improved: Admin table UI polished with consistent spacing and hover states.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.1.0 =
Recommended update — fixes an issue where the description and estimated delivery
date were not displayed due to WooCommerce session caching.
