=== YeeDiscounts - Dynamic Pricing & Discounts for WooCommerce ===
Contributors: addonsorg
Tags: woocommerce, dynamic pricing, discounts, bulk discount, shipping discount
Tested up to: 7.1
Stable tag: 2.0.0
WC requires at least: 4.0
WC tested up to: 11.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

YeeDiscounts allows you to create bulk discounts, BOGO deals, cart discounts, shipping discounts, and advanced dynamic pricing rules for WooCommerce.

== Description ==


[youtube https://www.youtube.com/watch?v=57clErJvQCs]

**YeeDiscounts - Dynamic Discounts for WooCommerce** is the ultimate pricing and discount toolkit for your store. Create simple to complex discount rules to boost sales, including Bulk Discounts (Tiered Pricing), Buy X Get X (BOGO), Buy X Get Y, Cart Discounts, Shipping Discounts, and more.

The plugin is designed to be lightweight, easy to use, and fully compatible with **WooCommerce High Performance Order Storage (HPOS)** and modern **Checkout Blocks**.

Pro Version: <https://add-ons.org/plugin/yeediscounts-pro/>
Document: <https://yeeplugin.github.io/YeeDiscounts/index.html>

### Features

*   **Two Application Methods**: Choose between **Automatic** (applied seamlessly at cart/checkout) or **Discount Code** (customers enter promo code at checkout with virtual coupon bridge).
*   **Simple Discounts**: Percentage, Fixed Amount, or Fixed Price adjustments per product.
*   **Bulk Discounts (Tiered Pricing)**: Setup quantity-based discounts (e.g., Buy 3-4 get 10% off, Buy 5+ get 20% off). Display tiered pricing tables on product pages.
*   **Buy X Get X (BOGO)**: Classic Buy One Get One Free/Discounted logic. Supports recursive rules (Buy 2 Get 1, Buy 4 Get 2...).
*   **Buy X Get Y**: Buy specific products/categories, get the same or different products for free or discounted (supports Auto Add, Cheapest in Cart, or Most Expensive in Cart).
*   **Cart Discounts**: Apply percentage or fixed discounts to the entire cart total. Supports applying as a Coupon or Fee.
*   **Bundle / Set Discounts**: Fixed price or percentage discount for a bundle of items (e.g., Buy 3 items for $100 or save 15%).
*   **Shipping Discounts**: 
    *   **Free shipping (100% off)**: Grant free shipping when qualifying conditions are met.
    *   **Percentage discount on shipping**: Deduct a percentage from the shipping cost (e.g., 50% off shipping).
    *   **Fixed amount discount on shipping**: Deduct a fixed amount from shipping fees (e.g., $5.00 off shipping).
    *   **Method Targeting**: Apply to all shipping methods or specific shipping methods/zones only.
*   **Customer Eligibility**: Target rules to All Customers, Specific Customer Roles / Segments, or Specific Customer Emails.
*   **Usage Limits**: Limit total usage count and enforce "Limit to one use per customer" (tracks user ID and billing email).
*   **Active Dates Scheduling**: Schedule start date/time and optional expiration end date/time.

### Advanced Conditions

Target your discounts precisely with a wide range of conditions:

*   **Cart Conditions**: Subtotal, Item Quantity, Line Item Count, Weight, Applied Coupons, Payment Method.
*   **Product Conditions**: Specific Products, Categories, Tags, Attributes, SKUs, On-Sale Status.
*   **Customer Conditions**: User Role, Logged-in Status, Email (specific or wildcard).
*   **History Conditions**: First Order, Last Order Amount, Total Spent, Number of Previous Orders.
*   **Geographic**: Shipping/Billing Country, State, City, Zipcode.
*   **Date & Time**: Date range, Time range, Days of the week.

### Frontend Features

*   **Discount Bar**: Display a progress bar or notification message to encourage customers to meet discount conditions (e.g., "Add $20 more to get 10% off").
*   **Bulk Discount Table**: Automatically display tiered pricing tables on product pages.
*   **Sale Badges**: Custom "On Sale" badges with dynamic labels (e.g., "Save 20%") or hiding badges unless rules match.
*   **Strikeout Prices**: Show original vs. discounted prices clearly in Shop, Product, and Cart pages.

### Admin & Management

*   **Modern Shopify/Coupons Style UI**: Two-column layout with real-time sidebar summary preview and quick actions.
*   **Dedicated Menu**: Integrated under Marketing / Coupons for fast access.
*   **Reports**: Track detailed performance metrics for each individual rule (orders count, total discount amount, order list).
*   **Import/Export**: Easily migrate rules between sites via JSON.
*   **Order Tracking**: Full discount details and rule IDs are saved to order items, fees, and shipping items for reliable analytics.

== Installation ==

1.  Upload the plugin folder to `/wp-content/plugins/`
2.  Activate **YeeDiscounts - Dynamic Discounts for WooCommerce**
3.  Go to **Marketing > Dynamic Discounts** (or **WooCommerce > Dynamic Discounts**) to create and manage rules.

== Screenshots ==

1.  **Rules Table**: Modern Shopify/Coupons styled rules list with method badges, status pills, and filters.
2.  **Rule Editor**: Clean two-column editor with live summary preview.
3.  **Reports Dashboard**: Comprehensive analytics on discounts and order performance.

== Changelog ==
= 2.0.0 =
*   Feature: Added comprehensive Shipping Discounts (Free shipping 100% off, Percentage discount, and Fixed amount discount on shipping fees).
*   Feature: Added option to target All shipping methods or specific shipping methods/zones.
*   Feature: Automatic shipping cache reset on coupon apply/remove for real-time shipping rate recalculation.
*   Feature: Two Application Methods - Automatic vs. Promo Code with WooCommerce Virtual Coupon bridge.
*   Feature: Customer Eligibility block (All customers, User Roles, Specific customer emails).
*   Feature: Usage limits (Total usage limit & One use per customer tracking).
*   Feature: Active dates with start and end date/time scheduling.
*   Feature: Individual rule report view with quick navigation and order audit table.
*   Enhancement: Redesigned rules table and editor in modern Shopify/Coupons style with live sidebar preview.
*   Enhancement: Added default sample rules covering all 7 discount types (disabled by default).
*   Fix: Resolved block visibility and script handling in rule editor.

= 1.1.0 =
*   Fixed: Buy X Get Y - Cheapest in Cart

= 1.0.3 =
*   Fix: Setting "Choose how the discount rules should apply"

= 1.0.2 =
*   Fix: UI tweaks for admin rule editor.

= 1.0.1 =
*   Feature: Added Reports section.
*   Feature: Added Import/Export rules.
*   Feature: Added Order Tracker to save rule details to order items/fees.
*   Enhancement: Refined Buy X Get Y logic (auto-add and sync).
*   Enhancement: Improved handling of Recursive BOGO rules.
*   Fix: UI tweaks for admin rule editor.

= 1.0.0 =
*   Initial release.