Create named affiliate links with custom codes and share ?affiliate_token=... URLs
Attribute orders back to the referring affiliate via an httpOnly SameSite cookie
Track per-link totals for completed orders, returns, and payout percentages
Run the module in a PrestaShop multi-store setup with per-shop attribution
Needs PrestaShop 8.0 to 8.9.x and PHP 8.0 or newer, and two known bugs (Copy button, edit-creates-new) still exist in 1.0.4.
KS Affiliation is a module for the PrestaShop 8 e-commerce platform that tracks affiliate links. The shop owner creates a named link with a code, shares URLs that include that code, and when a visitor clicks through, the module drops a cookie on their browser. If the visitor later places an order on the same store, the module records that the order belongs to that affiliate. Prerequisites are PrestaShop 8.0 through 8.9.x, PHP 8.0 or newer, and it works in multi-store setups. The module has two places where settings live. Global configuration sits under Modules > Module Manager and only has two knobs: which order state counts as a finished, paid, shipped order, and a Delay in days that adds onto PrestaShop's Merchandise Returns time limit before an order is treated as Completed. Per-link settings sit under Catalog > Affiliate Links and include a description, cookie lifespan, an optional payout percentage, an Active toggle, and the affiliate code itself. Codes are 3 to 64 alphanumeric characters, can be custom or auto-generated, and are locked once the link exists. Sharing a link is just adding ?affiliate_token=<code> to any store URL. On click the module sets an httpOnly, SameSite=Lax cookie for the configured lifespan, strips the token from the address bar with a server redirect and a JavaScript fallback, and leaves the visitor on the page they asked for. Multi-store is strict: a token created on Store A only attributes orders placed on Store A. When an order is validated, the module reads the cookie, looks up the link on the same shop, and writes one row into ks_affiliation_order linking the order to the affiliate. Each link has a View Orders dashboard with four panels: total completed orders amount, total orders amount, total returns amount, and total payout, all excluding shipping. Each order gets a status badge: Completed when there are no refunds and enough time has passed, Returned when every unit is refunded, Partially Completed when some units came back, and Awaiting for everything else. A manual Finished checkbox on each order is for the admin's own bookkeeping. The data model uses two tables, both dropped on uninstall. Current version is 1.0.4. The README lists two known bugs: the Copy button on affiliate URLs sometimes does not work, and editing a link creates a new one instead of updating it.
Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.