merge rel_3.x changes to trunk

Cette révision appartient à :
Daniel Seifert 2014-07-24 09:55:47 +00:00
révision b9273276dd
14 fichiers modifiés avec 247 ajouts et 35 suppressions

2
.gitattributes externe
Voir le fichier

@ -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

Voir le fichier

@ -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|escape:"quotes"}]', [{* // 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|escape:"quotes"}]', [{* // city *}]
'[{$order->oxorder__oxbillstate->value|escape:"quotes"}]', [{* // state or province *}]
'[{$order->oxorder__oxbillcountry->value|escape:"quotes"}]' [{* // 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|escape:"quotes"}]', [{* // SKU/code *}]
'[{$oOrderArticle->oxorderarticles__oxtitle->value|escape:"quotes"}]', [{* // product name *}]
'[{$oOrderArticle->oxorderarticles__d3_galocator->value|escape:"quotes"}]', [{* // 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}]

Voir le fichier

@ -14,7 +14,7 @@
ga('ecommerce:addTransaction', {
'id': '[{$order->oxorder__oxordernr->value}]', [{* Transaction ID. Required *}]
'affiliation': '[{$oxcmp_shop->oxshops__oxname->value}]', [{* Affiliation or store name *}]
'affiliation': '[{$oxcmp_shop->oxshops__oxname->value|escape:"quotes"}]', [{* Affiliation or store name *}]
'revenue': '[{$sTotal}]', [{* Gesamtwert *}]
'shipping': '[{$sShipping}]', [{* Versand *}]
'tax': '[{$sTax}]' [{* Steuer *}]
@ -31,9 +31,10 @@
ga('ecommerce:addItem', {
'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 *}]
'name': '[{$oOrderArticle->oxorderarticles__oxtitle->value|escape:"quotes"}]', [{* Produktname *}]
'sku': '[{$oOrderArticle->oxorderarticles__oxartnum->value|escape:"quotes"}]', [{* SKU/Code *}]
'category': '[{$oOrderArticle->oxorderarticles__d3_galocator->value|escape:"quotes"}]', [{* Kategorie oder Ausführung *}]
[{*'category': '[{$oOrderArticle->oxorderarticles__oxselvariant->value}]', [{* Kategorie oder Ausführung *}]
'price': '[{$sPrice}]', [{* Preis pro Einheit *}]
'quantity': '[{$oOrderArticle->oxorderarticles__oxamount->value}]' [{* Menge *}]
});

Voir le fichier

@ -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 {}

Voir le fichier

@ -34,17 +34,18 @@ $aModule = array(
'de' => 'Dieses Modul stellt Ihnen die schnelle und unkomplizierte Einbindung Ihres Google-Analytics-'.
'Kontos in Ihren Shop zur Verf&uuml;gung. Hierbei werden &uuml;ber standardisierte Schnittstellen die '.
'Besucherdaten und eCommerce-Daten zu Google &uuml;bertragen. Ebenfalls &uuml;bermittelt werden Daten '.
'der Website-Suche. Dem Modul liegen angepa&szlig;te Templates bei, mit denen auch die Trichter '.
'ordentlich protokolliert werden.',
'der Website-Suche.',
'en' => 'Provides a quick and easy integration with your Google Analytics account to your shop.',
),
'thumbnail' => 'picture.png',
'version' => '3.1.0.2',
'version' => '3.2.0.0',
'author' => 'D&sup3; Data Development (Inh. Thomas Dartsch)',
'email' => 'support@shopmodule.com',
'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',

Voir le fichier

@ -123,26 +123,57 @@ class d3_oxcmp_utils_googleanalytics extends d3_oxcmp_utils_googleanalytics_pare
{
$myConfig = oxRegistry::getConfig();
$aLanguageUrls = $myConfig->getConfigParam('aLanguageURLs');
$aUrls = array();
/** @var oxUBase $oActView */
$oActView = $myConfig->getTopActiveView();
$aSslLanguageUrls = $myConfig->getConfigParam('aLanguageSSLURLs');
$aUrls = array();
if ($myConfig->getConfigParam('bl_perfLoadLanguages')) {
$aLanguages = oxRegistry::getLang()->getLanguageArray(null, true, true);
reset($aLanguages);
while ((list($sKey, $oVal) = each($aLanguages))) {
$aLanguages[$sKey]->link = $oActView->getLink($oVal->id);
$sUrl = str_replace('http://', '', $aLanguageUrls[$oVal->id]);
if ($aLanguageUrls[$oVal->id] != $aLanguageUrls[oxRegistry::getLang()->getBaseLanguage()]) {
$aUrls[] = "'".$sUrl."'";
}
foreach ($aLanguages as $oVal) {
$aUrls = $this->_d3AddLanguageUrlsToList($aLanguageUrls, $oVal, $aSslLanguageUrls, $aUrls);
}
}
return $aUrls;
}
/**
* @param $aLanguageUrls
* @param $oVal
* @param $aSslLanguageUrls
* @param $aUrls
*
* @return array
*/
protected function _d3AddLanguageUrlsToList($aLanguageUrls, $oVal, $aSslLanguageUrls, $aUrls)
{
$blIsSsl = oxRegistry::getConfig()->isSsl();
if ($this->_d3CheckLanguageUrlsToList($aLanguageUrls, $oVal, $blIsSsl)) {
$sUrl = str_replace('http://', '', $aLanguageUrls[$oVal->id]);
$aUrls[] = "'" . $sUrl . "'";
}
if ($this->_d3CheckLanguageUrlsToList($aSslLanguageUrls, $oVal, !$blIsSsl)) {
$sSslUrl = str_replace('https://', '', $aSslLanguageUrls[$oVal->id]);
$aUrls[] = "'" . $sSslUrl . "'";
}
return $aUrls;
}
/**
* @param $aLanguageUrls
* @param $oVal
* @param $blIsSsl
*
* @return bool
*/
protected function _d3CheckLanguageUrlsToList($aLanguageUrls, $oVal, $blIsSsl)
{
return $blIsSsl || $aLanguageUrls[$oVal->id] != $aLanguageUrls[oxRegistry::getLang()->getBaseLanguage()];
}
/**
* @return string
*/

Voir le fichier

@ -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;
}
}

Voir le fichier

@ -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;
}
}

Voir le fichier

@ -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;
}
}

Voir le fichier

@ -237,7 +237,7 @@ function _groupExp(el) {
<label for="sD3GAAdWordConversionId">[{oxmultilang ident="D3_GOOGLEANALYTICS_ADWORDS_CONVID"}]</label>
</dt>
<dd>
<input type="text" class="edittext ext_edittext" size="15" maxlength="15" name="value[sD3GAAdWordConversionId]" value="[{$edit->getValue('sD3GAAdWordConversionId')}]">
<input type="text" class="edittext ext_edittext" size="15" maxlength="50" name="value[sD3GAAdWordConversionId]" value="[{$edit->getValue('sD3GAAdWordConversionId')}]">
[{oxinputhelp ident="D3_GOOGLEANALYTICS_ADWORDS_CONVID_DESC"}]
</dd>
</dl>
@ -246,7 +246,7 @@ function _groupExp(el) {
<label for="sD3GAAdWordConversionLabel">[{oxmultilang ident="D3_GOOGLEANALYTICS_ADWORDS_CONVLABEL"}]</label>
</dt>
<dd>
<input type="text" class="edittext ext_edittext" size="15" maxlength="15" name="value[sD3GAAdWordConversionLabel]" value="[{$edit->getValue('sD3GAAdWordConversionLabel')}]">
<input type="text" class="edittext ext_edittext" size="15" maxlength="50" name="value[sD3GAAdWordConversionLabel]" value="[{$edit->getValue('sD3GAAdWordConversionLabel')}]">
[{oxinputhelp ident="D3_GOOGLEANALYTICS_ADWORDS_CONVLABEL_DESC"}]
</dd>
</dl>

Voir le fichier

@ -6,7 +6,7 @@ class requConfig
public $sModId = 'd3_googleanalytics';
public $sModVersion = '3.1.0.2';
public $sModVersion = '3.2.0.0';
/********************** check configuration section ************************/

Voir le fichier

@ -1,3 +1,8 @@
=> 3.2.0.0
- Tracking für gekaufte Artikel enthält Daten zur Kategorie / Seite, aus der die Artikel zuerst in den Warenkorb gelegt wurden
- Bugfix: Artikeltitel werden escaped, sofern Quotes enthalten sind
- AutoLinker-URL enthält auch abweichende SSL-URLs
=> 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