merge #2416 branch to rel_3.x branch

This commit is contained in:
Daniel Seifert 2014-07-24 08:43:20 +00:00
bovenliggende 4ca0f90dfd ab9eaf64d6
commit e61bb002bf
10 gewijzigde bestanden met toevoegingen van 213 en 16 verwijderingen

2
.gitattributes vendored
Bestand weergeven

@ -180,6 +180,8 @@ copy_this/modules/d3/d3_googleanalytics/modules/components/d3_oxcmp_utils_google
copy_this/modules/d3/d3_googleanalytics/modules/controllers/d3_order_googleanalytics.php -text
copy_this/modules/d3/d3_googleanalytics/modules/controllers/d3_thankyou_googleanalytics.php -text
copy_this/modules/d3/d3_googleanalytics/modules/core/d3_oxutilsview_googleanalytics.php -text
copy_this/modules/d3/d3_googleanalytics/modules/models/d3_oxbasket_googleanalytics.php -text
copy_this/modules/d3/d3_googleanalytics/modules/models/d3_oxbasketitem_googleanalytics.php -text
copy_this/modules/d3/d3_googleanalytics/modules/models/d3_oxorder_googleanalytics.php -text
copy_this/modules/d3/d3_googleanalytics/picture.png -text
copy_this/modules/d3/d3_googleanalytics/setup/d3_googleanalytics_update.php -text

Bestand weergeven

@ -11,7 +11,7 @@
[{strip}]
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '[{ $oD3GASettings->getValue('sD3GAId') }]']);
_gaq.push(['_setAccount', '[{$oD3GASettings->getValue('sD3GAId')}]']);
[{if $oD3GASettings->getValue('blD3GAAnonymizeIP')}]
_gaq.push(['_gat._anonymizeIp']);
@ -137,33 +137,34 @@
[{assign var="currate" value=$order->oxorder__oxcurrate->value}]
_gaq.push(['_addTrans',
'[{ $order->oxorder__oxordernr->value }]', [{* // order ID - required *}]
'[{ $oxcmp_shop->oxshops__oxname->value}]', [{* // affiliation or store name *}]
[{if $oD3GASettings->getValue('blD3GAUseNetto') }]
'[{$order->oxorder__oxordernr->value}]', [{* // order ID - required *}]
'[{$oxcmp_shop->oxshops__oxname->value}]', [{* // affiliation or store name *}]
[{if $oD3GASettings->getValue('blD3GAUseNetto')}]
'[{math equation="s / r" s=$order->getOrderNetSum() r=$currate format="%.2f"}]', [{* // total - required - has to be gross sum *}]
[{else}]
'[{math equation="s / r" s=$order->getTotalOrderSum() r=$currate format="%.2f"}]', [{* // total - required *}]
[{/if}]
'[{math equation="s - r" s=$order->getTotalOrderSum() r=$order->getOrderNetSum() format="%.2f"}]', [{* // tax *}]
'[{math equation="s / r" s=$order->oxorder__oxdelcost->value r=$currate format="%.2f"}]', [{* // shipping *}]
'[{ $order->oxorder__oxbillcity->value }]', [{* // city *}]
'[{ $order->oxorder__oxbillstate->value }]', [{* // state or province *}]
'[{ $order->oxorder__oxbillcountry->value }]' [{* // country *}]
'[{$order->oxorder__oxbillcity->value}]', [{* // city *}]
'[{$order->oxorder__oxbillstate->value}]', [{* // state or province *}]
'[{$order->oxorder__oxbillcountry->value}]' [{* // country *}]
]);
[{foreach from=$order->getOrderArticles() item=oOrderArticle}]
_gaq.push(['_addItem',
'[{ $order->oxorder__oxordernr->value }]', [{* // order ID - required *}]
'[{ $oOrderArticle->oxorderarticles__oxartnum->value }]', [{* // SKU/code *}]
'[{ $oOrderArticle->oxorderarticles__oxtitle->value }]', [{* // product name *}]
'[{ $oOrderArticle->oxorderarticles__oxselvariant->value }]', [{* // category or variation *}]
[{if $oD3GASettings->getValue('blD3GAUseNetto') }]
'[{$order->oxorder__oxordernr->value}]', [{* // order ID - required *}]
'[{$oOrderArticle->oxorderarticles__oxartnum->value}]', [{* // SKU/code *}]
'[{$oOrderArticle->oxorderarticles__oxtitle->value}]', [{* // product name *}]
'[{$oOrderArticle->oxorderarticles__d3_galocator->value}]', [{* // category or variation *}]
[{*'[{$oOrderArticle->oxorderarticles__oxselvariant->value}]', [{* // category or variation *}]
[{if $oD3GASettings->getValue('blD3GAUseNetto')}]
[{assign var="oPrice" value=$oOrderArticle->getPrice()}]
'[{math equation="s / r" s=$oPrice->getNettoPrice() r=$currate format="%.2f"}]', [{* // unit price - required *}]
[{else}]
'[{ $oOrderArticle->oxorderarticles__oxprice->value }]', [{* // unit price - required - is not currency depended *}]
'[{$oOrderArticle->oxorderarticles__oxprice->value}]', [{* // unit price - required - is not currency depended *}]
[{/if}]
'[{ $oOrderArticle->oxorderarticles__oxamount->value }]' [{* // quantity - required *}]
'[{$oOrderArticle->oxorderarticles__oxamount->value}]' [{* // quantity - required *}]
]);
[{/foreach}]

Bestand weergeven

@ -33,7 +33,8 @@
'id': '[{$order->oxorder__oxordernr->value}]', [{* Transaktions-ID *}]
'name': '[{$oOrderArticle->oxorderarticles__oxtitle->value}]', [{* Produktname *}]
'sku': '[{$oOrderArticle->oxorderarticles__oxartnum->value}]', [{* SKU/Code *}]
'category': '[{$oOrderArticle->oxorderarticles__oxselvariant->value}]', [{* Kategorie oder Ausführung *}]
'category': '[{$oOrderArticle->oxorderarticles__d3_galocator->value}]', [{* Kategorie oder Ausführung *}]
[{*'category': '[{$oOrderArticle->oxorderarticles__oxselvariant->value}]', [{* Kategorie oder Ausführung *}]
'price': '[{$sPrice}]', [{* Preis pro Einheit *}]
'quantity': '[{$oOrderArticle->oxorderarticles__oxamount->value}]' [{* Menge *}]
});

Bestand weergeven

@ -29,4 +29,10 @@ class d3_thankyou_googleanalytics_parent extends thankyou {}
class d3_order_googleanalytics_parent extends order {}
/** */
class d3_oxutilsview_googleanalytics_parent extends oxUtilsView {}
class d3_oxutilsview_googleanalytics_parent extends oxUtilsView {}
/** */
class d3_oxbasket_googleanalytics_parent extends oxbasket {}
/** */
class d3_oxbasketitem_googleanalytics_parent extends oxBasketItem {}

Bestand weergeven

@ -45,6 +45,8 @@ $aModule = array(
'url' => 'http://www.oxidmodule.com/',
'extend' => array(
'oxcmp_utils' => 'd3/d3_googleanalytics/modules/components/d3_oxcmp_utils_googleanalytics',
'oxbasket' => 'd3/d3_googleanalytics/modules/models/d3_oxbasket_googleanalytics',
'oxbasketitem'=> 'd3/d3_googleanalytics/modules/models/d3_oxbasketitem_googleanalytics',
'oxorder' => 'd3/d3_googleanalytics/modules/models/d3_oxorder_googleanalytics',
'order' => 'd3/d3_googleanalytics/modules/controllers/d3_order_googleanalytics',
'oxutilsview' => 'd3/d3_googleanalytics/modules/core/d3_oxutilsview_googleanalytics',

Bestand weergeven

@ -0,0 +1,85 @@
<?php
/**
* This Software is the property of Data Development and is protected
* by copyright law - it is NOT Freeware.
*
* Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by
* civil and criminal law.
*
* http://www.shopmodule.com
*
* @copyright © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com
*/
class d3_oxbasket_googleanalytics extends d3_oxbasket_googleanalytics_parent
{
/**
* @return string
*/
public function d3GetCurrentLocatorTitle()
{
$sTitle = '';
$oView = oxRegistry::getConfig()->getActiveView();
if (method_exists($oView, 'getBreadCrumb') &&
($aPaths = $oView->getBreadCrumb())
) {
foreach ($aPaths as $aPath) {
$sTitle .= "/".$aPath['title'];
}
} elseif ($oView->getClassName() == 'details' &&
(
($oCatPath = $oView->getCategoryTree()->getPath()) ||
($oCatPath = $oView->getManufacturerTree()->getPath())
)
) {
foreach ($oCatPath as $oCat) {
$sTitle .= "/".$oCat->getFieldData('oxtitle');
}
} else {
$sTitle = "page: ".ucfirst($oView->getClassName());
}
return $sTitle;
}
/**
* @param string $sProductID
* @param float $dAmount
* @param null $aSel
* @param null $aPersParam
* @param bool $blOverride
* @param bool $blBundle
* @param null $sOldBasketItemId
*
* @return object
*/
public function addToBasket(
$sProductID,
$dAmount,
$aSel = null,
$aPersParam = null,
$blOverride = false,
$blBundle = false,
$sOldBasketItemId = null
) {
$oBasketItem = parent::addToBasket(
$sProductID,
$dAmount,
$aSel,
$aPersParam,
$blOverride,
$blBundle,
$sOldBasketItemId
);
if ($oBasketItem) {
$oBasketItem->d3SetLocatorTitle($this->d3GetCurrentLocatorTitle());
}
return $oBasketItem;
}
}

Bestand weergeven

@ -0,0 +1,38 @@
<?php
/**
* This Software is the property of Data Development and is protected
* by copyright law - it is NOT Freeware.
*
* Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by
* civil and criminal law.
*
* http://www.shopmodule.com
*
* @copyright © Data Development, Thomas Dartsch
* @author Data Development - Daniel Seifert <ds@shopmodule.com>
* @link http://www.oxidmodule.com
*/
class d3_oxbasketitem_googleanalytics extends d3_oxbasketitem_googleanalytics_parent
{
protected $_sD3LocatorTitle;
/**
* @param $sLocatorTitle
*/
public function d3SetLocatorTitle($sLocatorTitle)
{
if (false == $this->_sD3LocatorTitle) {
$this->_sD3LocatorTitle = $sLocatorTitle;
}
}
/**
* @return string
*/
public function d3GetLocatorTitle()
{
return $this->_sD3LocatorTitle;
}
}

Bestand weergeven

@ -51,4 +51,46 @@ class d3_oxorder_googleanalytics extends d3_oxorder_googleanalytics_parent
return $aVoucherSerieList;
}
/**
* @param array $aArticleList
*
* @return null|void
*/
protected function _setOrderArticles( $aArticleList )
{
parent::_setOrderArticles($aArticleList);
/** @var d3_oxbasketitem_googleanalytics $oBasketItem */
foreach ($aArticleList as $oBasketItem) {
$oOrderArticle = $this->_d3getOrderArticleFromBasketItem($oBasketItem);
if ($oOrderArticle) {
$aContent['d3_galocator'] = $oBasketItem->d3GetLocatorTitle();
$oOrderArticle->assign($aContent);
$oOrderArticle->save();
}
}
}
/**
* @param oxbasketitem $oBasketItem
*
* @return false|oxorderarticle
*/
protected function _d3getOrderArticleFromBasketItem($oBasketItem)
{
$aPersParams = $oBasketItem->getPersParams();
/** @var oxorderarticle $oOrderArticle */
foreach ($this->_oArticles as $sArticleId => $oOrderArticle) {
if ($oOrderArticle->getFieldData('oxartid') == $oBasketItem->getProductId() &&
$oOrderArticle->getFieldData('oxamount') == $oBasketItem->getAmount() &&
(null == $aPersParams || $oOrderArticle->getFieldData('oxpersparam') == $aPersParams)
) {
return $this->_oArticles->offsetGet($sArticleId);
}
}
return false;
}
}

Bestand weergeven

@ -43,6 +43,10 @@ mM9";
'check' => 'checkModCfgItemExist',
'do' => 'updateModCfgItemExist'
),
array(
'check' => 'checkFields',
'do' => 'fixFields'
),
array(
'check' => 'checkContentGANoticeItemExist',
'do' => 'updateContentGANoticeItemExist'
@ -53,6 +57,19 @@ mM9";
),
);
public $aFields = array(
'D3_GALOCATOR' => array(
'sTableName' => 'oxorderarticles',
'sFieldName' => 'D3_GALOCATOR',
'sType' => 'VARCHAR(255)',
'blNull' => false,
'sDefault' => '',
'sComment' => '',
'sExtra' => '',
'blMultilang' => false,
),
);
protected $_aRefreshMetaModuleIds = array('d3_googleanalytics');
/**

Bestand weergeven

@ -1,3 +1,6 @@
=> ??
- Tracking für gekaufte Artikel enthält Daten zur Kategorie / Seite, aus der die Artikel zuerst in den Warenkorb gelegt wurden
=> 3.1.0.2
- Bugfix: deaktiviertes Modul kann benötigtes Objekt nicht laden
- Bugfix: Seiten ohne Klassenangaben (z.B. 404-Seiten) versuchen Artikellisten für Remarketing zu laden