OXID eShop CE 4.10.1 tpl/widget/dynscript.tpl 
[{oxscript}]
[{assign var="oConfig" value=$oViewConf->getConfig()}]
<script type="text/javascript">[{strip}]
var sBaseUrl = '[{$oViewConf->getSelfActionLink()}]';
var sActCl = '[{$oViewConf->getTopActiveClassName()}]';
[{/strip}]</script>
10 [{* Google Analytics Page Tracking *}]
11 [{assign var="sGATrackingId" value=$oViewConf->getViewThemeParam('sGATrackingId')}]
12 [{if $oViewConf->getViewThemeParam('blUseGAPageTracker') && $sGATrackingId}]
13  <script>
14  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
15  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
16  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
17  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
18 
19  ga('create', '[{$sGATrackingId}]');
20  [{* IP-Adressen anonymisieren *}]
21  [{if $oViewConf->getViewThemeParam('blGAAnonymizeIPs')}]
22  ga('set', 'anonymizeIp', true);
23  [{/if}]
24  ga('send', 'pageview');
25  </script>
26 [{/if}]
27 
28 [{* Google Analytics eCommerce Tracking *}]
29 [{if $oViewConf->getViewThemeParam('blUseGAEcommerceTracking') && $sGATrackingId && $oViewConf->getTopActiveClassName() == 'thankyou'}]
30  [{assign var="oOrder" value=$oView->getOrder()}]
31 
32  [{if $oOrder}]
33  [{if !$oViewConf->getViewThemeParam('blUseGAPageTracker')}]
34  <script>
35  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
36  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
37  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
38  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
39 
40  ga('create', '[{$sGATrackingId}]');
41  [{* IP-Adressen anonymisieren *}]
42  [{if $oViewConf->getViewThemeParam('blGAAnonymizeIPs')}]
43  ga('set', 'anonymizeIp', true);
44  [{/if}]
45  </script>
46  [{/if}]
47 
48  <script>
49  ga( 'require', 'ecommerce' );
50 
51  ga( 'ecommerce:addTransaction', {
52  'id': '[{$oOrder->oxorder__oxordernr->value}]', // Transaction ID. Required.
53  'affiliation': '[{$oxcmp_shop->oxshops__oxname->value}]', // Affiliation or store name.
54  'revenue': '[{$oOrder->oxorder__oxtotalordersum->value}]', // Grand Total.
55  'shipping': '[{$oOrder->oxorder__oxdelcost->value}]', // Shipping.
56  'tax': '[{math equation="x+y" x=$oOrder->oxorder__oxartvatprice1->value y=$oOrder->oxorder__oxartvatprice2->value}]' // Tax.
57  });
58 
59  [{foreach from=$oOrder->getOrderArticles() item="oOrderArticle"}]
60  [{assign var="sArticleName" value=$oOrderArticle->oxorderarticles__oxtitle->value|cat:' '|cat:$oOrderArticle->oxorderarticles__oxselvariant->value}]
61  [{assign var="sCategoryName" value=""}]
62  [{assign var="oOrderArticlePrice" value=$oOrderArticle->getPrice()}]
63  [{assign var="oArticle" value=$oOrderArticle->getArticle()}]
64  [{if $oArticle}]
65  [{assign var="oMainCategory" value=$oArticle->getCategory()}]
66  [{if $oMainCategory}]
67  [{assign var="sCategoryName" value=$oMainCategory->oxcategories__oxtitle->value}]
68  [{/if}]
69  [{/if}]
70  ga( 'ecommerce:addItem', {
71  'id': '[{$oOrder->oxorder__oxordernr->value}]', // Transaction ID. Required.
72  'name': '[{$sArticleName|trim}]', // Product name. Required.
73  'sku': '[{$oOrderArticle->oxorderarticles__oxartnum->value}]', // SKU/code.
74  'category': '[{$sCategoryName}]', // Category or variation.
75  'price': '[{$oOrderArticlePrice->getBruttoPrice()}]', // Unit price.
76  'quantity': '[{$oOrderArticle->oxorderarticles__oxamount->value}]', // Quantity.
77  'currency': '[{$oOrder->oxorder__oxcurrency->value}]' // local currency code.
78  });
79  [{/foreach}]
80 
81  ga('ecommerce:send' );
82  </script>
83  [{/if}]
84 [{/if}]
85 
86 [{* Google zertifizierte Händler *}]
87 [{if $oViewConf->getViewThemeParam('blUseGoogleTS')}]
88  [{assign var="sGoogleVendorId" value=$oViewConf->getViewThemeParam('sGoogleVendorId')}]
89  [{assign var="sGoogleShoppingAccountId" value=$oViewConf->getViewThemeParam('sGoogleShoppingAccountId')}]
90  [{assign var="sPageLanguage" value=$oViewConf->getViewThemeParam('sPageLanguage')}]
91  [{assign var="sShoppingCountry" value=$oViewConf->getViewThemeParam('sShoppingCountry')}]
92  [{assign var="sShoppingLanguage" value=$oViewConf->getViewThemeParam('sShoppingLanguage')}]
93 
94  [{if $oViewConf->getTopActiveClassName() == 'details'}]
95  [{assign var="oArticle" value=$oView->getProduct()}]
96  [{assign var="sGoogleShoppingProductId" value=$oArticle->oxarticles__oxartnum->value}]
97  [{/if}]
98 
99  [{if $sGoogleVendorId && $sPageLanguage}]
100  [{* Händler-Gütesiegelcode *}]
101  <script type="text/javascript">
102  var gts = gts || [];
103 
104  gts.push(["id", "[{$sGoogleVendorId}]"]);
105  gts.push(["badge_position","BOTTOM_RIGHT"]);
106  gts.push(["locale", "[{$sPageLanguage|default:'de_DE'}]"]);
107  [{if $sGoogleShoppingAccountId}]
108  gts.push(["google_base_subaccount_id", "[{$sGoogleShoppingAccountId}]"]);
109  gts.push(["google_base_offer_id", "[{$sGoogleShoppingProductId}]"]);
110  [{if $sShoppingCountry}]
111  gts.push(["google_base_country", "[{$sShoppingCountry|default:'DE'}]"]);
112  [{/if}]
113  [{if $sShoppingLanguage}]
114  gts.push(["google_base_language", "[{$sShoppingLanguage|default:'de'}]"]);
115  [{/if}]
116  [{/if}]
117 
118  (function() {
119  var gts = document.createElement("script");
120  gts.type = "text/javascript";
121  gts.async = true;
122  gts.src = "https://www.googlecommerce.com/trustedstores/api/js";
123  var s = document.getElementsByTagName("script")[0];
124  s.parentNode.insertBefore(gts, s);
125  })();
126  </script>
127 
128  [{* Bestellbestätigungs-Modul *}]
129  [{if $oViewConf->getTopActiveClassName() == 'thankyou'}]
130  [{assign var="sShippingDaysOnStock" value=$oViewConf->getViewThemeParam('sShippingDaysOnStock')}]
131  [{assign var="sShippingDaysNotOnStock" value=$oViewConf->getViewThemeParam('sShippingDaysNotOnStock')}]
132  [{assign var="sDeliveryDaysOnStock" value=$oViewConf->getViewThemeParam('sDeliveryDaysOnStock')}]
133  [{assign var="sDeliveryDaysNotOnStock" value=$oViewConf->getViewThemeParam('sDeliveryDaysNotOnStock')}]
134 
135  [{if $sShippingDaysOnStock && $sShippingDaysNotOnStock && $sDeliveryDaysOnStock && $sDeliveryDaysNotOnStock}]
136  [{if !$oOrder}]
137  [{assign var="oOrder" value=$oView->getOrder()}]
138  [{/if}]
139 
140  [{assign var="sShopURL" value=$oConfig->getConfigParam('sShopURL')}]
141  [{assign var="aShopDomain" value=$sShopURL|@parse_url}]
142  [{assign var="blHasPreOrder" value=false}]
143  [{assign var="oBasket" value=$oView->getBasket()}]
144  [{assign var="oCountry" value="oxCountry"|@oxNew}]
145  [{if $oCountry->load($oOrder->oxorder__oxbillcountryid->value)}]
146  [{assign var="sCustomerCountry" value=$oCountry->oxcountry__oxisoalpha2->value}]
147  [{/if}]
148 
149  <!-- START Google Zertifizierte Händler Order -->
150  <div id="gts-order" style="display:none;" translate="no">
151  [{* Zuerst die Artikel der Bestellung iterieren um Informationen für die Bestelldaten zu sammeln *}]
152  [{capture name="sGtsItems"}]
153  [{foreach from=$oOrder->getOrderArticles() item="oOrderArticle"}]
154  [{assign var="oArticle" value=$oOrderArticle->getArticle()}]
155  [{assign var="oOrderArticlePrice" value=$oOrderArticle->getPrice()}]
156  [{assign var="sArticleName" value=$oOrderArticle->oxorderarticles__oxtitle->value|cat:' '|cat:$oOrderArticle->oxorderarticles__oxselvariant->value}]
157  [{if !$blHasPreOrder && $oArticle->getStockStatus() == -1}]
158  [{assign var="blHasPreOrder" value=true}]
159  [{/if}]
160 
161  <span class="gts-item">
162  <span class="gts-i-name">[{$sArticleName|trim}]</span>
163  <span class="gts-i-price">[{$oOrderArticlePrice->getBruttoPrice()}]</span>
164  <span class="gts-i-quantity">[{$oOrderArticle->oxorderarticles__oxamount->value}]</span>
165  <span class="gts-i-prodsearch-id">[{$oOrderArticle->oxorderarticles__oxartnum->value}]</span>
166  [{if $sGoogleShoppingAccountId}]
167  <span class="gts-i-prodsearch-store-id">[{$sGoogleShoppingAccountId}]</span>
168  [{if $sShoppingCountry}]
169  <span class="gts-i-prodsearch-country">[{$sShoppingCountry|default:'DE'}]</span>
170  [{/if}]
171  [{if $sShoppingLanguage}]
172  <span class="gts-i-prodsearch-language">[{$sShoppingLanguage|default:'de'}]</span>
173  [{/if}]
174  [{/if}]
175  </span>
176  [{/foreach}]
177  [{/capture}]
178 
179  [{* voraussichtliches Versanddatum berechnen *}]
180  [{if $blHasPreOrder}]
181  [{assign var="sShipDate" value="`$sShippingDaysNotOnStock` weekdays"|strtotime}]
182  [{else}]
183  [{assign var="sShipDate" value="`$sShippingDaysOnStock` weekdays"|strtotime}]
184  [{/if}]
185 
186  [{* voraussichtliches Lieferdatum berechnen *}]
187  [{if $blHasPreOrder}]
188  [{assign var="sDeliveryDate" value="`$sDeliveryDaysNotOnStock` weekdays"|strtotime}]
189  [{else}]
190  [{assign var="sDeliveryDate" value="`$sDeliveryDaysOnStock` weekdays"|strtotime}]
191  [{/if}]
192 
193  <span id="gts-o-id">[{$oOrder->oxorder__oxordernr->value}]</span>
194  <span id="gts-o-domain">[{$aShopDomain.host}]</span>
195  <span id="gts-o-email">[{$oOrder->oxorder__oxbillemail->value}]</span>
196  <span id="gts-o-country">[{$sCustomerCountry}]</span>
197  <span id="gts-o-currency">[{$oOrder->oxorder__oxcurrency->value}]</span>
198  <span id="gts-o-total">[{$oOrder->oxorder__oxtotalordersum->value}]</span>
199  <span id="gts-o-discounts">[{if $oOrder->oxorder__oxdiscount->value > 0}]-[{/if}][{$oOrder->oxorder__oxdiscount->value}]</span>
200  <span id="gts-o-shipping-total">[{$oOrder->oxorder__oxdelcost->value}]</span>
201  <span id="gts-o-tax-total">[{math equation="x+y" x=$oOrder->oxorder__oxartvatprice1->value y=$oOrder->oxorder__oxartvatprice2->value}]</span>
*** 
202  <span id="gts-o-est-ship-date">[{"Y-m-d"|@date:$sShipDate}]</span>
203  <span id="gts-o-est-delivery-date">[{"Y-m-d"|@date:$sDeliveryDate}]</span>
204  <span id="gts-o-has-preorder">[{if $blHasPreOrder}]Y[{else}]N[{/if}]</span>
205  <span id="gts-o-has-digital">[{if $oBasket->hasDownloadableProducts()}]Y[{else}]N[{/if}]</span>
206 
207  [{if $smarty.capture.sGtsItems}]
208  [{$smarty.capture.sGtsItems}]
209  [{/if}]
210  </div>
211  [{/if}]
212  <!-- END Google Zertifizierte Händler Order -->
213  [{/if}]
214  [{/if}]
215 [{/if}]
 
2 lines changed or deleted