=== LoyalPanther Loyalty for WooCommerce ===
Contributors: loyalpanther
Tags: loyalty, points, rewards, woocommerce, discount
Requires at least: 6.3
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.5.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Award loyalty points on WooCommerce orders and let customers redeem them for a discount at checkout. One account for shop and webshop.

== Description ==

Connect your WooCommerce store to your LoyalPanther loyalty program. One loyalty
account works across your physical shop and your webshop.

* **Earn** — when an order is paid (completed or processing), points are awarded
  automatically using your LoyalPanther earn rate and product rules. The buyer's
  loyalty account is looked up or created by email.
* **Redeem** — logged-in customers see their points balance on the cart and
  checkout and can redeem points for a one-time discount, applied instantly.
  Works on both the classic and the block-based checkout.

The plugin does not modify LoyalPanther itself; it only calls the public
LoyalPanther API over HTTPS with your API key. It is compatible with WooCommerce
High-Performance Order Storage (HPOS) and the Cart & Checkout Blocks.

== Installation ==

1. Upload the plugin zip via Plugins → Add New → Upload Plugin, then activate it.
2. In LoyalPanther: Dashboard → Settings → Integrations → API keys, create a key.
   Enable flexible redemption (rate, minimum, step) for the redeem feature.
3. In WooCommerce → LoyalPanther, tick "Enabled", paste your API key, choose when
   to award points, and save.

== Frequently Asked Questions ==

= Does it require WooCommerce? =
Yes. WooCommerce must be installed and active.

= Where are points and vouchers stored? =
In LoyalPanther. The plugin only talks to the LoyalPanther API. Redeemed points
create a one-time WooCommerce coupon that is applied to the cart.

= Does it work with the new block checkout? =
Yes. The redeem widget renders on both the classic and the block-based checkout.

= Are points awarded more than once per order? =
No. Awards are guarded by order meta and an idempotency key on the API side.

== External services ==

This plugin connects your site to LoyalPanther (https://loyalpanther.app), the
loyalty platform it is built for. Using the API key you configure, it sends data
to the LoyalPanther API (https://loyalpanther.app/api) so points can be awarded
and redeemed:

* When an order is paid: the buyer's name and email, and the order's line items,
  totals and a reference id — to award points.
* When a customer views the cart/checkout or redeems points: the customer's
  email — to look up the balance and create a discount voucher.
* When an order is cancelled or refunded: a voucher reference — to refund points.

No data is sent until you enter an API key and enable the plugin. Use of the
service is subject to the LoyalPanther Terms (https://loyalpanther.app/terms) and
Privacy Policy (https://loyalpanther.app/privacy).

== Screenshots ==

1. Customers redeem loyalty points for a discount at checkout (classic and block).
2. Simple settings — paste your API key, choose when to award points, and go.

== Changelog ==

= 1.5.1 =
* Aligned the text domain with the plugin slug, added a translation template, and tidied up per WordPress coding standards (input sanitization, translation loading).

= 1.5.0 =
* Redeemed points are refunded automatically when the order is cancelled or refunded.

= 1.4.0 =
* Optional guest redemption: guests can redeem points at the block checkout by entering their email (opt-in setting).

= 1.3.0 =
* Points are now reserved and only deducted when the order is placed, so an abandoned checkout never costs points.

= 1.2.5 =
* Block checkout support for the redeem widget (ExperimentalOrderMeta slot).
* Themed, theme-adaptive widget styling with a brandable accent colour.
* HPOS and Cart/Checkout Blocks compatibility declared.
* WooCommerce dependency check, translations loading, uninstall cleanup.

= 1.1.0 =
* Redeem points for a discount on the classic cart/checkout.

= 1.0.0 =
* Earn points on paid orders + customer sync.
