=== Affiliate Program for WooCommerce – Gatemi ===
Contributors: gatemi
Tags: woocommerce, affiliate, referral, commission, partner program
Requires at least: 6.4
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

An affiliate program for your WooCommerce store: referral links, commissions decided once when the order is placed, and an affiliate dashboard.

== Description ==

People send you customers; you pay them a share. A referral link, a ledger you
can explain, and a page in My Account.

**A commission is decided once, when the order is placed, and frozen onto it.**
The affiliate and the rate are written at that moment and never worked out
again. A plugin that recomputes later has you lowering your rate and silently
shrinking every pending payout in the shop — including for sales made under the
old terms.

**Only the goods count, and only a paid order earns.** Commission is worked out
on the line items, net of refunds — not on shipping and not on tax, because
paying a share of the VAT is paying the tax authority's money to an affiliate.

**One order is one commission — in the schema.** `UNIQUE (order_id)` is not an
optimisation; it is the guarantee. WooCommerce fires its status hooks more than
once in ordinary operation, and a check-then-insert in PHP loses that race.

**An affiliate is never paid for their own order.** Checked two ways — the
account that placed it, and the billing address on it.

= Also =

* An affiliate's own dashboard on the Affiliate tab of My Account: their link,
  their visits and their figures — and nobody else's
* A commission is **reversed**, never deleted, when an order is refunded
* Applications approved by a human, from one screen

= What it deliberately does not do =

**It does not move money.** This plugin has no gateway, cannot send anybody
anything, and never asks for a credential that could.

= The full edition =

[Gatemi Affiliates for WooCommerce](https://gatemi.com/plugins/affiliates-for-woocommerce/)
is a separate plugin, sold on gatemi.com, that adds a rate for one person,
recorded payouts, a referral window of the length you set, and a link to
your programme terms on the application form. This plugin remembers a
referral for 30 days, credits the first referral, and pays everybody the one
programme rate.

Both editions store their data the same way — the same tables, the same
option, the same cookie and meta keys — so upgrading keeps every affiliate,
every link already handed out and every commission earned.

== External services ==

**None.** This plugin makes no HTTP request of any kind.

== Frequently Asked Questions ==

= What happens to commissions if I uninstall? =

They stay. The tables are a ledger of money owed to real people, and they are
shared with the full edition.

= Can an affiliate see my orders? =

No. Their page shows a date, an amount and a status — not the order number, not
the customer, not what was bought.

== Screenshots ==

1. The settings screen.

== Changelog ==

= 1.0.0 =
* First release.
* Referral links per affiliate, a commission decided once when the order is created and frozen onto it, one flat programme rate, and an affiliate dashboard in My Account.
* One order is one commission whatever happens — the claim is a UNIQUE index — and only a paid order earns; a refund reverses.
* Nobody is paid for their own order, checked by account and by billing address.
* Uninstall never touches an affiliate, a link already handed out or a commission earned.
