git404hub

what is ks_affiliation fr?

agentpietrucha/ks_affiliation — explained in plain English

Analysis updated 2026-05-18

1PHPAudience · developerComplexity · 3/5Setup · moderate

tl;dr

PrestaShop 8 module that tracks affiliate links via cookie attribution, ties orders back to the referring code, and shows per-link dashboards with payout and refund tracking.

vibe map

mindmap
  root((ks_affiliation))
    Inputs
      Affiliate token URL
      Cookie
      PrestaShop order events
    Outputs
      Linked order rows
      Per-link dashboard
      Payout totals
    Use Cases
      Pay affiliates a percentage
      Track campaign clicks
      Audit returns by affiliate
      Run multi-store attribution
    Tech Stack
      PHP
      PrestaShop
      MySQL
      JavaScript

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

what do people make with this?

VIBE 1

Create named affiliate links with custom codes and share ?affiliate_token=... URLs

VIBE 2

Attribute orders back to the referring affiliate via an httpOnly SameSite cookie

VIBE 3

Track per-link totals for completed orders, returns, and payout percentages

VIBE 4

Run the module in a PrestaShop multi-store setup with per-shop attribution

what's the stack?

PHPPrestaShopMySQLJavaScript

how it stacks up fr

agentpietrucha/ks_affiliationcyberwizard-dev/laravel-ftp-deployermungell/twitteroauth
Stars111
LanguagePHPPHPPHP
Last pushed2012-01-21
MaintenanceDormant
Setup difficultymoderateeasymoderate
Complexity3/52/52/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

how do i run it?

Difficulty · moderate time til it works · 1h+

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.

in plain english

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.

prompts (copy fr)

prompt 1
Walk me through installing ks_affiliation on PrestaShop 8.1 with PHP 8.2
prompt 2
Explain how the Delay in days setting interacts with PrestaShop's Merchandise Returns time limit
prompt 3
Show me the ks_affiliation_order table schema and how it links back to orders
prompt 4
Help me work around the known bug where editing an affiliate link creates a new one instead of updating it
prompt 5
Tell me how multi-store strict attribution behaves when the same token is reused across shops

Frequently asked questions

what is ks_affiliation fr?

PrestaShop 8 module that tracks affiliate links via cookie attribution, ties orders back to the referring code, and shows per-link dashboards with payout and refund tracking.

What language is ks_affiliation written in?

Mainly PHP. The stack also includes PHP, PrestaShop, MySQL.

How hard is ks_affiliation to set up?

Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.

Who is ks_affiliation for?

Mainly developer.

peek the repo → explain another one

This repo across BitVibe Labs

double-check against the repo, no cap.