=== Kung Woo Add Warranty for WooCommerce ===
Contributors: kungwoopanda
Tags: woocommerce, warranty, product protection, extended warranty, upsell
Requires at least: 5.8
Tested up to: 7.0
WC requires at least: 5.0
WC tested up to: 8.7
Stable tag: 1.0.1
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Increase your store revenue by offering extended warranties in a beautiful popup just before adding products to the cart.

== Description ==

**Kung Woo Add Warranty for WooCommerce** is a complete, powerful WooCommerce add-on designed to increase average order value by easily upselling product warranties and extended protection plans.

It intercepts the "Add to cart" click and shows the customer a beautiful, fully customizable modal with additional warranty plans calculated automatically as a percentage of the product price.

### Powerful Features:
* **Interactive Popup Modal:** Catch customers right before they add the product to the cart with two warranty tiers (e.g. Basic and Full).
* **Automatic Price Calculation:** Define the warranty price as a percentage of the original product price.
* **My Account Integration:** Customers can view their active and expired warranties directly from a dedicated "My Warranties" tab in their WooCommerce Account.
* **1-Click Renewals:** If a warranty is expiring, the customer can renew it with a single click.
* **Automatic Email Reminders:** Built-in cron job sends automatic email reminders 30 days before the warranty expires.
* **Admin Dashboard:** A dedicated dashboard page for the shop owner to track and manage all purchased warranties.
* **Per-Product Activation:** Choose exactly which products trigger the warranty popup via a simple checkbox in the WooCommerce product edit screen.

== Installation ==

1. Upload the entire `kung-woo-add-warranty` folder to the `/wp-content/plugins/` directory, or install it directly through the WordPress plugins screen.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Go to **WooCommerce -> Opcje Gwarancji** to configure your popup text, colors, percentages, and warranty terms.
4. Edit any WooCommerce product and check the "Enable additional warranty popup" box in the General tab.
5. You're all set! Customers will now see the warranty options when adding the product to their cart.

== Frequently Asked Questions ==

= How is the warranty price calculated? =
The warranty price is dynamically calculated as a percentage of the current product price. You can set this percentage in the plugin settings (e.g., 10% for Basic, 20% for Full).

= Where can I see purchased warranties? =
Go to **WooCommerce -> Purchased Warranties**. There you'll find a clean, filtered list of all orders that include an extended warranty, along with their start and expiration dates.

= How do automatic reminders work? =
The plugin runs a daily background task (Cron Job). If it detects that a purchased warranty is expiring in 30 days or less, it will automatically send an email to the customer with a link to renew it.

== Screenshots ==

1. The frontend warranty popup modal before adding to cart.
2. The "My Warranties" tab in the customer's My Account section.
3. The Admin dashboard showing all purchased warranties.
4. Plugin settings to configure colors, pricing, and text.

== Changelog ==

= 1.0.1 =
* Fix: Replaced hardcoded inline `<style>` and `<script>` tags with proper WordPress enqueue functions (`wp_add_inline_style` and `wp_add_inline_script`) to improve compatibility and performance.
* Fix: Renamed global classes, functions, and variables to use a unique plugin prefix (`kungwoad_`) instead of the common `wc_` prefix, preventing potential collisions with WooCommerce core.

= 1.0 =
* Initial release for the WordPress Plugin Repository.
* Fully functional frontend modal and backend tracking.
* Automated renewal emails and My Account endpoints integration.