PHPackages                             xddesigners/shop-affiliate-marketing - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. xddesigners/shop-affiliate-marketing

ActiveSilverstripe-vendormodule[Utility &amp; Helpers](/categories/utility)

xddesigners/shop-affiliate-marketing
====================================

Adds affiliate marketing s2s postback support to SilverShop orders

0.1.2(4y ago)2161BSD-3-ClausePHP

Since Apr 19Pushed 4y ago2 watchersCompare

[ Source](https://github.com/xddesigners/shop-affiliate-marketing)[ Packagist](https://packagist.org/packages/xddesigners/shop-affiliate-marketing)[ RSS](/packages/xddesigners-shop-affiliate-marketing/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (4)Used By (0)

XD Silvershop Affiliate marketing
=================================

[](#xd-silvershop-affiliate-marketing)

Adds affiliate marketing s2s postback support to SilverShop orders. The module comes with a abstract AffiliateProvider class where implementation for different providers can be based upon. A default implementation for Tune's HasOffers platform already exists.

What it is
----------

[](#what-it-is)

Affiliate marketing is used by marketeers to generate leads with affiliate networks. Affilate partners can use links with affliate id's in blog posts for example.

Configuration
-------------

[](#configuration)

### Has Offers

[](#has-offers)

You can configure the following parameters on the Has Offers implementation:

```
XD\Shop\AffiliateMarketing\Providers\HasOffers:
  default_offer_id: 71 # the default offer to map your conversions to
  transaction_id_var: 'clickid' # the query parameter name that holds the transaction id
  affiliate_id_var: 'pub' # the query parameter name that holds the affiliate id
```

If you work with multiple goals or offers id's and don't want to make use of the default parameter you can extend the `HasOffers` class:

```
class HasOffersExtension extends Extension
{
  public function onBeforePostBack(&$query, $order)
  {
    // if the order matches the case of the different offer or goal
    if ($order->matchesDifferentCase()) {
      $query['offer_id'] = 'my_offer_id';
    }
  }
}
```

### Create a custom AffiliateProvider

[](#create-a-custom-affiliateprovider)

If you have a different affiliate provider you can extend the abstract AffiliateProvider class and implement the methods `sessionFromRequest` and `doPostBack`. The first method is used to get and store the id you need for your postback in the session. The `doPostBack` method is called by the order when paid and should call the provider's server with the stored id.

```
class MyAffiliateProvider extends AffiliateProvider
{
    /**
     * Set the required session data from the request
     */
    public function sessionFromRequest(HTTPRequest $request)
    {
        $transactionId = $request->getVar('transaction_id');
        $affiliateId = $request->getVar('affiliate_id');
        if ($transactionId && $affiliateId) {
            $session = $request->getSession();
            $session->set('MyAffiliateProvider.TransactionID', $transactionId);
            $session->set('MyAffiliateProvider.AffiliateID', $affiliateId);
            $session->save($request);
        }
    }

    /**
     * Handle the postback to the affiliate provider
     */
    public function doPostBack(HTTPRequest $request, Order $order)
    {
        // send the postback to your affiliate partners server
    }
}
```

Configure the injector to use your custom affiliate provider:

```
SilverStripe\Core\Injector\Injector:
  AffiliateProvider:
    class: MyAffiliateProvider
```

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~39 days

Total

3

Last Release

1822d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6131c03b7f5ba6b10fef192c90d68d57508e84c007a13321df6960b8298e19d1?d=identicon)[TheBnl](/maintainers/TheBnl)

---

Tags

silverstripemarketingaffiliatesilvershop

### Embed Badge

![Health badge](/badges/xddesigners-shop-affiliate-marketing/health.svg)

```
[![Health](https://phpackages.com/badges/xddesigners-shop-affiliate-marketing/health.svg)](https://phpackages.com/packages/xddesigners-shop-affiliate-marketing)
```

###  Alternatives

[silverstripe/userforms

UserForms enables CMS users to create dynamic forms via a drag and drop interface and without getting involved in any PHP code

1371.1M85](/packages/silverstripe-userforms)[symbiote/silverstripe-advancedworkflow

Adds configurable workflow support to the CMS, with a GUI for creating custom workflow definitions.

46302.4k9](/packages/symbiote-silverstripe-advancedworkflow)[silverstripe/sharedraftcontent

Share draft page content with non-CMS users

21424.1k12](/packages/silverstripe-sharedraftcontent)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
