=== Webengine Loyalty for WooCommerce ===
Contributors: webenginedev
Tags: woocommerce, loyalty, points, rewards, discount
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Loyalty points program for WooCommerce: earn points on orders, tier-based discounts applied as a coupon, free shipping rewards and points expiration.

== Description ==

Webengine Loyalty adds a simple, configurable points program to your WooCommerce shop:

* **Earning**: points per amount spent (taxes included, shipping excluded) or a fixed number per order. Optionally no points when a coupon is used.
* **Tiers**: define discount tiers ("from N points: X off per group of Y points"), optionally with **free shipping**.
* **Redemption as a native coupon**: the discount is applied as a (virtual) WooCommerce coupon — correct tax handling, visible in totals, removable by the customer with the native ✕ button. Works with the **classic shortcode cart/checkout and the block cart/checkout** (Store API).
* **Automatic or manual**: auto-apply when eligible (customer can opt out), or a "Use my points" button on the classic cart/checkout.
* **Safety rules**: minimum paid orders, minimum cart amount, no combination with other coupons (each rule configurable).
* **Full lifecycle**: points are credited only when the order is paid (processing/completed); cancellations and refunds claw points back; **partial refunds re-align earned points**; redeemed points are restored if the order is cancelled.
* **Points expiration**: optionally expire balances after N months without activity (daily background task).
* **Admin tools**: customers & balances screen with manual adjustments, full transaction log (earned / redeemed / adjusted / reversed / expired), points column in the users list, points panel on each order, and a loyalty section on the user profile.
* **Customer account**: a "Loyalty" tab in My Account with balance, available discount, progress to the next tier and points history.

Compatible with High-Performance Order Storage (HPOS).

== Frequently Asked Questions ==

= When are points credited? =

When the order reaches a paid status (processing or completed) — so bank transfer and cheque orders only earn points once you confirm payment. Both hooks are idempotent: points are never credited twice.

= How is the discount applied? =

As a virtual WooCommerce coupon (code `wlfw-…`). This gives native display everywhere, including the block checkout. The customer can remove it like any coupon; the plugin remembers that choice for the session.

= How does the discount interact with taxes (VAT)? =

The advertised discount is what the customer actually saves on the total to pay, taxes included — whatever your tax setup. When prices are entered excluding tax, the coupon amount is automatically converted to its pre-tax equivalent (using the cart's effective rate, mixed rates included) so the tax-inclusive reduction matches the points' value exactly: the customer never gets less than promised, and the shop never gives away the discount's VAT on top.

= Does free shipping work with any shipping setup? =

The loyalty coupon carries the native `free_shipping` flag, so a Free Shipping method set to require "a valid free shipping coupon" works out of the box. The plugin also makes the Free Shipping method available directly when a free-shipping tier is applied.

= What happens on refunds? =

A cancelled or fully refunded order reverses its earned points and restores redeemed ones. A partial refund recalculates the points the order should have earned on the net amount and adjusts the balance accordingly.

= Is it compatible with HPOS? =

Yes, the plugin declares HPOS compatibility and uses only CRUD order APIs.

== Screenshots ==

1. Settings: earning rules and discount tiers.
2. Customers & points with manual adjustment.
3. Transaction history.
4. The customer's Loyalty tab in My Account.

== Changelog ==

= 1.0.0 =
* Initial release.
