-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9ae6a40
Showing
7 changed files
with
171 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
$sLangName = "Deutsch"; | ||
|
||
$aLang = array( | ||
'charset' => 'UTF-8', | ||
|
||
'SHOP_MODULE_GROUP_rs-awin_main' => 'Grundeinstellungen', | ||
'SHOP_MODULE_rs-awin_id' => 'Advertiser Id', | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
namespace rs\awin\Core\Controller; | ||
|
||
class ThankYouController extends ThankYouController_parent | ||
{ | ||
|
||
public function init() | ||
{ | ||
$sRet = parent::init(); | ||
$this->rs_awin(); | ||
return $sRet; | ||
} | ||
protected function rs_awin() | ||
{ | ||
|
||
/** | ||
* @var \oxorder $oOrder | ||
*/ | ||
$oOrder = $this->getOrder(); | ||
|
||
$sMerchant = (int) $this->getConfig()->getConfigParam('rs-awin_id'); | ||
if($sMerchant!="") | ||
{ | ||
$awc = \OxidEsales\Eshop\Core\Registry::getUtilsServer()->getOxCookie('awc'); | ||
|
||
$url = "https://www.awin1.com/sread.php?tt=ss&tv=2&merchant=".$sMerchant; | ||
$url .= "&amount=" . $oOrder->getTotalOrderSum(); | ||
$url .= "&ch=aw"; | ||
$url .= "&cr=" . $oOrder->getOrderCurrency()->name; | ||
$url .= "&ref=" . $oOrder->oxorder__oxordernr->value; | ||
$url .= "&parts=DEFAULT:" . $oOrder->getTotalOrderSum(); | ||
$url .= "&testmode=0&vc=" . ""; | ||
if ($awc!="") { | ||
$url .= "&cks=" . $awc; // Populate the Awin click checksum if one is associated with the conversion | ||
} | ||
|
||
$c = curl_init(); | ||
curl_setopt($c, CURLOPT_CONNECTTIMEOUT, 10); | ||
curl_setopt($c, CURLOPT_RETURNTRANSFER, true); | ||
curl_setopt($c, CURLOPT_URL, $url); | ||
curl_exec($c); | ||
curl_close($c); | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace rs\awin\Core; | ||
|
||
use OxidEsales\Eshop\Core\Request; | ||
|
||
class ViewConfig extends ViewConfig_parent | ||
{ | ||
/** | ||
* set awin cookie | ||
*/ | ||
public function rs_awin() | ||
{ | ||
$request = oxNew(Request::class); | ||
$sValue=$request->getRequestParameter("awc"); | ||
if($sValue!="") | ||
{ | ||
$iDays=365; | ||
$sName = "awc"; | ||
$iTime = time() + $iDays*24*60*60; | ||
\OxidEsales\Eshop\Core\Registry::getUtilsServer()->setOxCookie($sName, $sValue, $iTime); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Oxid Cookie Manager | ||
|
||
## Description | ||
|
||
Implement the Awin tracking. | ||
|
||
https://wiki.awin.com/index.php/Advertiser_Tracking_Guide/Conversion_Pixel_Only_Tracking | ||
|
||
## Install | ||
|
||
1. Copy module into following directory | ||
|
||
source/modules/rs/awin | ||
|
||
2. Add following to composer.json on the shop root | ||
|
||
"autoload": { | ||
"psr-4": { | ||
"rs\\awin\\": "./source/modules/rs/awin" | ||
} | ||
}, | ||
|
||
3. Refresh autoloader files with composer in the oxid root directory. | ||
|
||
composer dump-autoload | ||
|
||
6. Enable module in the oxid admin area, Extensions => Modules | ||
|
||
7. Set you awin-id into the module settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "rs/awin", | ||
"description": "awin", | ||
"type": "oxideshop-module", | ||
"keywords": ["oxid", "modules", "eShop", "cookie", "affiliate", "marketing"], | ||
"homepage": "https://www.reisacher-software.de", | ||
"license": [ | ||
"GPL-3.0-only", | ||
"proprietary" | ||
], | ||
"extra": { | ||
"oxideshop": { | ||
"target-directory": "rs/awin" | ||
} | ||
}, | ||
"require": { | ||
"php": ">=5.3" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"rs\\awin\\": "../../../source/modules/rs/awin" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
$sMetadataVersion = '2.0'; | ||
|
||
$aModule = array( | ||
'id' => 'rs-awin', | ||
'title' => '*RS awin', | ||
'description' => 'Affiliate Marketing Awin', | ||
'thumbnail' => '', | ||
'version' => '1.0.0', | ||
'author' => 'Thomas Janda', | ||
'url' => 'https://www.awin.com', | ||
'email' => '', | ||
|
||
'extend' => array( | ||
\OxidEsales\Eshop\Core\ViewConfig::class => rs\awin\Core\ViewConfig::class, | ||
\OxidEsales\Eshop\Application\Controller\ThankYouController::class => \rs\awin\Core\Controller\ThankYouController::class, | ||
), | ||
'controllers' => array( | ||
), | ||
'blocks' => array( | ||
array( | ||
'template' => 'layout/base.tpl', | ||
'block' => 'base_js', | ||
'file' => '/views/blocks/layout/base__base_js.tpl', | ||
), | ||
), | ||
'settings' => array( | ||
array( | ||
'group' => 'rs-awin_main', | ||
'name' => 'rs-awin_id', //advertiserId | ||
'type' => 'str', | ||
'value' => '', | ||
), | ||
), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[{$smarty.block.parent}] | ||
[{$oViewConf->rs_awin()}] |