This commit is contained in:
Daniel Seifert 2014-10-13 14:56:53 +00:00
parent 681c834ca9
commit e18b6774f9
2 changed files with 58 additions and 15 deletions

View File

@ -5,7 +5,7 @@
gts.push(["id", "[{$oD3GASettings->getValue('sD3GATSId')}]"]);
gts.push(["badge_position", "BOTTOM_RIGHT"]);
gts.push(["locale", "de_DE"]);
gts.push(["locale", "[{$sD3CurrentGTSLang}]"]);
[{*
gts.push(["google_base_offer_id", "foo"]);
gts.push(["google_base_subaccount_id", "foo"]);
@ -26,18 +26,29 @@
[{if $oViewConf->getActiveClassName() == 'thankyou'}]
[{* https://support.google.com/trustedstoresmerchant/answer/6063087?hl=de&ref_topic=6063044 *}]
[{assign var="oOrder" value=$oView->getOrder()}]
[{assign var="oOrderCurrency" value=$oOrder->getOrderCurrency()}]
[{assign var="oUser" value=$oOrder->getOrderUser()}]
[{assign var="oUserCountry" value=$oUser->getUserCountry()}]
[{if $oD3GASettings->getValue('blD3GAUseNetto')}]
[{assign var="sTotal" value=$oOrder->getOrderNetSum()}] [{* // total - required - has to be gross sum *}]
[{else}]
[{assign var="sTotal" value=$oOrder->getTotalOrderSum()}] [{* // total - required *}]
[{/if}]
<!-- START Google Trusted Stores Order -->
<div id="gts-order" style="display:none;" translate="no">
<!-- start order and merchant information -->
<span id="gts-o-id">MERCHANT_ORDER_ID</span>
<span id="gts-o-domain">MERCHANT_ORDER_ID</span>
<span id="gts-o-email">MERCHANT_ORDER_ID</span>
<span id="gts-o-country">MERCHANT_ORDER_ID</span>
<span id="gts-o-currency">MERCHANT_ORDER_ID</span>
<span id="gts-o-total">MERCHANT_ORDER_ID</span>
<span id="gts-o-discounts">MERCHANT_ORDER_ID</span>
<span id="gts-o-shipping-total">MERCHANT_ORDER_ID</span>
<span id="gts-o-tax-total">MERCHANT_ORDER_ID</span>
<span id="gts-o-id">[{$oOrder->getFieldData('oxordernr')}]</span>
<span id="gts-o-domain">[{$oxcmp_shop->oxshops__oxurl->value}]</span>
<span id="gts-o-email">[{$oUser->getFieldData('oxusername')}]</span>
<span id="gts-o-country">[{$oCountry->getFieldData('OXISOALPHA2')}]</span>
<span id="gts-o-currency">[{$oOrderCurrency->name}]</span>
<span id="gts-o-total">[{$sTotal|string_format:"%.2f"}]</span>
<span id="gts-o-discounts">-[{$oOrder->getFieldData('oxdiscount')}]</span>
<span id="gts-o-shipping-total">[{$oOrder->getFieldData('oxdelcost')}]</span>
<span id="gts-o-tax-total">[{math equation="fi + se + th + fo" fi=$oOrder->getFieldData('oxartvatprice1') se=$oOrder->getFieldData('oxartvatprice2') th=$oOrder->getFieldData('oxpayvat') fo=$oOrder->getFieldData('oxdelvat') format="%.2f"}]</span>
<span id="gts-o-est-ship-date">MERCHANT_ORDER_ID</span>
<span id="gts-o-est-delivery-date">MERCHANT_ORDER_ID</span>
<span id="gts-o-est-has-preorder">MERCHANT_ORDER_ID</span>
@ -45,11 +56,19 @@
<!-- end order and merchant information -->
<!-- start repeated item specific information -->
<!-- item example: this area repeated for each item in the order -->
[{foreach from=$order->getOrderArticles() item=oOrderArticle}]
[{if $oD3GASettings->getValue('blD3GAUseNetto')}]
[{assign var="oPrice" value=$oOrderArticle->getPrice()}]
[{assign var="sPrice" value=$oPrice->getNettoPrice()}]
[{else}]
[{assign var="sPrice" value=$oOrderArticle->oxorderarticles__oxprice->value}]
[{/if}]
<span class="gts-item">
<span class="gts-i-name">ITEM_NAME</span>
<span class="gts-i-price">ITEM_NAME</span>
<span class="gts-i-quantity">ITEM_NAME</span>
<span class="gts-i-name">[{$oOrderArticle->oxorderarticles__oxtitle->value|escape:"quotes"}]</span>
<span class="gts-i-price">[{$sPrice|string_format:"%.2f"}]</span>
<span class="gts-i-quantity">[{$oOrderArticle->getFieldData('oxamount')}]</span>
[{*
<span class="gts-i-prodsearch-id">ITEM_NAME</span>
<span class="gts-i-prodsearch-store-id">ITEM_NAME</span>
@ -57,7 +76,7 @@
<span class="gts-i-prodsearch-language">ITEM_NAME</span>
*}]
</span>
<!-- end item 1 example -->
[{/foreach}]
<!-- end repeated item specific informations -->
</div>
<!-- END Google Trusted Stores Order -->

View File

@ -55,6 +55,7 @@ class d3_oxcmp_utils_googleanalytics extends d3_oxcmp_utils_googleanalytics_pare
$oParentView->addTplParam('sAFEGetMoreUrls', $this->afGetMoreUrls());
$oParentView->addTplParam('sD3GASendPageViewParameter', $this->d3getSendPageViewParameters());
$oParentView->addTplParam('sD3CurrentShopUrl', $this->d3GetCreateCurrentShopUrl());
$oParentView->addTplParam('sD3CurrentGTSLang', $this->d3GetGTSLang());
if ($oSet->getValue('blD3GASetRemarketing')) {
$aInfos = $this->d3GetGAProdInfos();
@ -99,6 +100,14 @@ class d3_oxcmp_utils_googleanalytics extends d3_oxcmp_utils_googleanalytics_pare
return 'auto';
}
return $this->d3GetCurrentShopUrl();
}
/**
* @return string
*/
public function d3GetCurrentShopUrl()
{
return oxRegistry::getConfig()->getActiveShop()->getFieldData('oxurl');
}
@ -275,6 +284,21 @@ class d3_oxcmp_utils_googleanalytics extends d3_oxcmp_utils_googleanalytics_pare
return 'Siteview';
}
/**
* @return string
*/
public function d3GetGTSLang()
{
$aHomeCountries = oxRegistry::getConfig()->getConfigParam('aHomeCountry');
$sHomeCountryId = $aHomeCountries[array_keys($aHomeCountries)[0]];
/** @var oxcountry $oCountry */
$oCountry = oxNew('oxcountry');
$oCountry->load($sHomeCountryId);
return strtolower(oxRegistry::getLang()->getLanguageAbbr()).'_'.
strtoupper($oCountry->getFieldData('OXISOALPHA2'));
}
/**
* @return string
*/