giftuals/affiliate-link-builder
最新稳定版本:v1.2.2
Composer 安装命令:
composer require giftuals/affiliate-link-builder
包简介
PHP library that allows you to create affiliate links from original URLs.
README 文档
README
PHP library that allows you to create affiliate links from original URLs.
Requirements
- PHP >= 8.3.7
Didn't test how far you can get behind, but this definately works.
Installation
composer require giftuals/affiliate-link-builder
Supported affiliate networks
Configuration
Because merchants switch networks and there are merchants that try out multiple platforms at once, you configure each host individually.
The configuration of each host is an array that contains 2 keys:
Bol.com
Bol.com only requires you to configure:
$config = [
'hosts' => [
'bol.com' => [
'builder_fqcn' => BolComBuilder::class,
'network_settings' => [
'client_specific' => [
'kadolijst.nl' => ['site_id' => $bol_com_nl_affiliate_id],
'cadeaulijst.be' => ['site_id' => $bol_com_be_affiliate_id],
],
],
],
],
];
Awin
To build affiliate links for Awin, you need:
$config = [
'hosts' => [
'www.dreamland.be' => [
'builder_fqcn' => AwinBuilder::class,
// Always use the Belgian affiliate program to create links for the Belgian website, no matter which client
// requests it.
'network_settings' => [
'affiliate_id' => $awin_be_affiliate_id,
'merchant_id' => 16159,
]
],
],
];
Daisycon
Daisycon requires you to configure four parameters:
$config = [
'hosts' => [
'www.lazylama.nl' => [
'builder_fqcn' => DaisyconBuilder::class,
'network_settings' => [
'client_specific' => [
'kadolijst.nl' => [
'redirect_host' => 'jdt8.net',
'si' => 17366,
'li' => 1750503,
'wi' => $daisycon_nl_affiliate_id,
],
],
],
],
],
];
TradeTracker
TradeTracker links require the following:
$config = [
'hosts' => [
'www.babykadowinkel.nl' => [
'builder_fqcn' => TradeTrackerBuilder::class,
'network_settings' => [
'affiliate_url_pattern' => 'https://www.babykadowinkel.nl/website/Includes/TradeTracker/?tt=<programID>_12_<affiliateID>_&r=%s',
],
],
],
];
Example usage
$config = [
'hosts' => [
'bol.com' => [
'builder_fqcn' => 'Giftuals\AffiliateLinkBuilder\Builders\BolComBuilder',
'network_settings' => [
'site_id' => 123,
],
],
],
];
$builder = new Giftuals\AffiliateLinkBuilder\AffiliateLinkBuilder($config);
$url = 'https://www.bol.com/nl/nl/p/furreal-friends-cubby-interactive-plush-curious-bear/9200000113960520';
$affiliate_link = $builder->getAffiliateLink($url);
Authors
Coen Coppens (giftuals)
License
Licensed under the MIT License
统计信息
- 总下载量: 21
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-09-19