=== Discount Mania - Conditional Discounts ===
Contributors: ashiktarik
Tags: woocommerce, discounts, dynamic pricing, bogo, buy x get y
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.2
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Conditional WooCommerce discounts with product, category, quantity, subtotal and Buy X Get Y rules.

== Description ==

**Discount Mania** is a high-performance, conversion-focused WooCommerce extension designed to create dynamic, tiered, and conditional promotions with zero complexity. Boost Average Order Value (AOV) through intelligent Quantity Discounts, Cart Subtotal Thresholds, and Buy X Get Y (BOGO / Buy X Get Y Free or Discounted) deals.

### Key Features

* **Admin Dashboard Overview Table**: Bird's-eye view of all configured discount rules with live status badges (`Active` / `Paused`).
* **Instant One-Click Pause / Resume**: AJAX-driven toggle switches let you pause or activate promotions in real-time without reloading the page.
* **Modern Segmented Switch UI**: Intuitive, tactile switch for percentage and fixed discount types.
* **Full Color & Display Customization**: Live color pickers for primary accent, success badge, offer badges, and reward buttons.
* **Promotional Alerts**: Beautiful notification cards on cart and checkout pages with animated progress bars.
* **Interactive Reward Gift Cards**: Displays eligible Buy X Get Y reward items with thumbnails, discount badges, and quick claim actions.
* **Single Product Page Upsell**: Automatically showcases matching Buy X Get Y promotions directly on product pages below the Add to Cart form.
* **Variable Product Intelligence**: Automatically routes variable items to single product pages for option selection and simple products directly to cart.
* **Hierarchical Category Matching**: Supports ancestor category matching so promotions apply across subcategories seamlessly.

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/discount-mania-conditional-discounts` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Use the **WooCommerce > Discount Mania** screen to configure your discount rules and customize your promotional colors.

== Frequently Asked Questions ==

= Does this plugin require WooCommerce? =
Yes, WooCommerce 6.0 or higher is required.

= Can I pause a promotion without deleting it? =
Yes! You can toggle the Active/Paused switch on any rule in the admin overview table or inside the rule card at any time.

= Are variable products supported for Buy X Get Y offers? =
Yes. If a reward product has variations (like sizes or colors), the plugin provides a "Select options" button linking directly to the product page so the customer can choose their desired variant.

== Changelog ==

= 1.0.2 =
* Feature: Added direct "Settings" quick action link on the WordPress Installed Plugins screen.
* Fix: Capped cumulative discounts to prevent stacked promotions from exceeding cart subtotal or resulting in negative totals.
* Fix: Implemented item-level, tax-aware fee apportionment for accurate tax deductions in mixed and reduced-rate carts.
* Fix: Improved Buy X Get Y fee calculation to use actual cart unit price after coupons and line discounts.
* Fix: Updated Buy X Get Y progress notices to track total reward quantity earned across multiple groups.
* Fix: Added strict whitelist validation on promotion rule settings (rule types, targets, discount types).
* Fix: Added WooCommerce active dependency check with dismissible admin notice to prevent fatal errors when WooCommerce is deactivated.

= 1.0.0 =
* Initial public release with Quantity Discounts, Subtotal Thresholds, and Buy X Get Y promotion engines.
* Admin dashboard overview table with live AJAX pause/resume toggles.
* Integrated color customization system with CSS variables.
* Cart, checkout, and single product page promotional showcase widgets.
* WordPress Plugin Check (PCP) compliance and WordPress Plugin Boilerplate structure.

== Upgrade Notice ==

= 1.0.2 =
Fixes tax calculations in mixed carts, prevents discount stacking past cart subtotal, adds Settings link on Plugins page, and improves Buy X Get Y notices.

= 1.0.0 =
Initial release of Discount Mania.
