Poolcorner: Unterschied zwischen den Versionen

Aus Wikizone
Wechseln zu: Navigation, Suche
Zeile 155: Zeile 155:
  
 
<!--{if $PRODUCTS_ADDED != ''}<p class="productinfoproductadded">{$PRODUCTS_ADDED}</p>{/if}-->
 
<!--{if $PRODUCTS_ADDED != ''}<p class="productinfoproductadded">{$PRODUCTS_ADDED}</p>{/if}-->
 +
 +
== Google Analytics ==
 +
 +
nach fogender Anleitung eingebaut:
 +
http://www.xtc-modified.org/wiki/Google_Analytics_datenschutzkonform_einbinden
 +
 +
1. Folgenden Code im Header "/includes/header.php" im Head-Bereich (wo ist eigentlich egal, Google empfiehlt vor dem schließenden head-tag) einbauen.
 +
 +
  <script type="text/javascript"><br>   
 +
    var _gaq = _gaq || [];
 +
        _gaq.push(['_setAccount', 'UA-xxxxxxxx-x']);
 +
        _gaq.push(['_gat._anonymizeIp']);
 +
        _gaq.push(['_trackPageview']);<br>   
 +
  </script>
 +
 +
Damit steht er im Quelltext dort wo er hin soll, nämlich ganz oben.
 +
 +
2. Den asynchronen Funktionsaufruf für das eCommerce-Tracking unten in "/templates/xt5/module/checkout_success.html" einbinden und
 +
 +
    <!-- Google e-Commerce Analytics -->
 +
    <script type="text/javascript">
 +
        _gaq.push(['_addTrans',
 +
            '{$oID}',
 +
            'Name deines Shops',
 +
            '{$VALUE}',
 +
            '{$TAX}',
 +
            '{$SHIPPING}',
 +
            '{$CITY}',
 +
            '{$STATE}',
 +
            '{$COUNTRY}'
 +
        ]);
 +
        {foreach name=aussen item=order_values from=$order_data}
 +
        _gaq.push(['_addItem',
 +
            '{$oID}',
 +
            '{$order_values.PRODUCTS_MODEL}',
 +
            '{$order_values.PRODUCTS_NAME}',
 +
            '{$order_values.CAT}',
 +
            '{$order_values.PRODUCTS_SINGLE_PRICE}',
 +
            '{$order_values.PRODUCTS_QTY}'
 +
        ]);
 +
        {/foreach}
 +
        _gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
 +
    </script>
 +
    <!-- Google e-Commerce Analytics Ende -->
 +
 +
die checkout_success.php aus dem entsprechenden "e-commerce-analytics-xtcModified 1.0x.zip" Paket aus dem Thema ANLEITUNG: E-Commerce-Tracking mit Google Analytics ins root-Verzeichnis des Shops legen. Somit wird der Code bei erfolgtem Einkauf in der Mitte aufgerufen.
 +
 +
3. Damit der Rest des Codes am Seitenende geladen wird, muss in der "/templates/xt5/source/boxes.php" vor der Zeile:
 +
 +
  $smarty->assign('tpl_path','templates/'.CURRENT_TEMPLATE.'/');
 +
 +
folgendes geschrieben werden:
 +
 +
  $GOOGLE_ANALYTICS =
 +
  '<script type="text/javascript">
 +
 +
    (function() {
 +
      var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;
 +
      ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';
 +
      var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);
 +
    })();
 +
 +
    </script>';
 +
    $smarty->assign('GOOGLE_ANALYTICS', $GOOGLE_ANALYTICS);
 +
 +
4. Zum Schluss muss noch in der "/templates/xt5/index.html" ganz unten
 +
 +
  {$GOOGLE_ANALYTICS}
 +
 +
rein.
 +
 +
Nun sollte Google Analytics funktionieren.

Version vom 16. Mai 2012, 08:55 Uhr

Installiert

Domnowski

EOS-Iframe

Attribute_price_updater

http://www.xtc-modified.org/forum/index.php?topic=2122.0



ATTRIBUTE PRICE UPDATER VERS 0.90 RC4 for XTC MODIFIED (c) by web28 - www.rpa-com.de

based on a script by D Parry (Chrome) 2007 (dan@virtuawebtech.co.uk)

FUNKTIONWEISE:

Der ATTRIBUTE PRICE UPDATER berechnet aus den Optionswerten per JavaScript den Gesamtpreis des Artikels


INSTALLATION - 3 files to edit, 4 file to copy:


1. EDIT includes/header.php

FIND '</head>' at ca. line 260 and ADDED before:

<?php if (strstr($PHP_SELF, FILENAME_PRODUCT_INFO )) {

   echo ('<link rel="stylesheet" type="text/css" href="' . 'templates/'.CURRENT_TEMPLATE.'/apu.css' . '" />');

require('includes/attribute_price_updater.js.php'); } ?>


2. EDIT includes/modules/product_attributes.php

FIND 'while ($products_options_name = xtc_db_fetch_array($products_options_name_query,true)) {'

at ca. line 36 and ADDED before:

//BOF ATTRIBUTE PRICE UPDATER $apu_js_var =; $apu_js_prices= ; $curr = $xtPrice->currencies[$xtPrice->actualCurr]; $decimal_places = $curr['decimal_places']; //needed for round

   $apu_js_curr = "var decimalPlaces=" . $decimal_places . "; \n";

$apu_js_curr.= "var decimalPoint ='" . $curr['decimal_point'] ."'; \n"; $apu_js_curr.= "var thousandPoint ='" . $curr['thousands_point'] ."'; \n"; $apu_js_curr.= "var currLeft ='" . $curr['symbol_left'] . "'; \n"; $apu_js_curr.= "var currRight ='" . $curr['symbol_right'] . "'; \n"; $apu_js_init = "var isPriceUpdater= 0; \n"; //EOF ATTRIBUTE PRICE UPDATER

FIND (the second entry before //if PRICE for option is 0 we don't need to display it): '$products_options_data[$row]['DATA'][$col] = array ('ID' => $products_options['products_options_values_id'], 'TEXT'...

and ADDED before:

//BOF ATTRIBUTE PRICE UPDATER

   $apu_js_var .= "apu_var[" . $products_options['products_options_values_id']  . "]='" . round($price,$decimal_places) . "|" . $products_options['price_prefix'] . "'; \n";

$apu_js_prices = "var basePrice=". $products_price ."; \n"; //EOF ATTRIBUTE PRICE UPDATER

FIND 'if ($product->data['options_template'] == or $product->data['options_template'] == 'default') {...

and ADDED before:

//BOF ATTRIBUTE PRICE UPDATER if ($_SESSION['customers_status']['customers_status_show_price'] != '0' && $xtPrice->checkAttributes($product->data['products_id']) != ) { $apu_js_init = "var isPriceUpdater= 1; \n"; } $module_smarty->assign('APU_INIT', $apu_js_init); $module_smarty->assign('APU_JS', $apu_js_var); $module_smarty->assign('APU_CURR', $apu_js_curr); $module_smarty->assign('APU_PRICES', $apu_js_prices); //EOF ATTRIBUTE PRICE UPDATER


3. EDIT lang/YOUR LANGUAGES/YOUR LANGUAGES.php

ADDED in your languages files - GERMAN EXAMPLE:

//ATTRIBUTE PRICE UPDATER define('UPDATER_PREFIX_TEXT', 'Ihre Auswahl: ');


4. COPY the file attribute_price_updater.js.php to the folder includes/

  COPY the file apu.css to the folder templates/YOURTEMPLATE/
  COPY the file product_options_dropdown_apu.html to the folder templates/YOURTEMPLATE/module/product_options
  COPY the file product_options_selection_apu.html to the folder templates/YOURTEMPLATE/module/product_options
  

5. Test the ATTRIBUTE_PRICE_UPDATER


6. SET/UNSET the DEBUG modus

OPEN the file attribute_price_updater.js.php

and set var _debug = false; to var _debug = true;

If all tests are ok, set it to false


7. CHANGE HTML OUTPUT OPEN the file attribute_price_updater.js.php

and find //HTML OUTPUT apuProductPrice

Edit the code


8. CHANGE PRICE UPDATE ON LOADING PAGE OPEN the file attribute_price_updater.js.php

and set var onloadPriceUpdate = false; to var onloadPriceUpdate = true;


9. Don't forget to chose one of the new ***_apu.html product_options template for your products.


That's all


Geändert Erweiterte Suche

Hersteller entfernt

/templates/xtc5/module/advanced_search.html


Zeile 20 -23 auskommentiert

Geänderte Detailansicht

vorletzte Zeile, Datum harausgenommen:


Google Analytics

nach fogender Anleitung eingebaut: http://www.xtc-modified.org/wiki/Google_Analytics_datenschutzkonform_einbinden

1. Folgenden Code im Header "/includes/header.php" im Head-Bereich (wo ist eigentlich egal, Google empfiehlt vor dem schließenden head-tag) einbauen.

 <script type="text/javascript">
var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-xxxxxxxx-x']); _gaq.push(['_gat._anonymizeIp']); _gaq.push(['_trackPageview']);
</script>

Damit steht er im Quelltext dort wo er hin soll, nämlich ganz oben.

2. Den asynchronen Funktionsaufruf für das eCommerce-Tracking unten in "/templates/xt5/module/checkout_success.html" einbinden und

   <script type="text/javascript">
       _gaq.push(['_addTrans',
           '{$oID}',
           'Name deines Shops',
           '{$VALUE}',
           '{$TAX}',
           '{$SHIPPING}',
           '{$CITY}',
           '{$STATE}',
           '{$COUNTRY}'
       ]);
       {foreach name=aussen item=order_values from=$order_data}
       _gaq.push(['_addItem',
           '{$oID}',
           '{$order_values.PRODUCTS_MODEL}',
           '{$order_values.PRODUCTS_NAME}',
           '{$order_values.CAT}',
           '{$order_values.PRODUCTS_SINGLE_PRICE}',
           '{$order_values.PRODUCTS_QTY}'
       ]);
       {/foreach}
       _gaq.push(['_trackTrans']); //submits transaction to the Analytics servers
   </script>

die checkout_success.php aus dem entsprechenden "e-commerce-analytics-xtcModified 1.0x.zip" Paket aus dem Thema ANLEITUNG: E-Commerce-Tracking mit Google Analytics ins root-Verzeichnis des Shops legen. Somit wird der Code bei erfolgtem Einkauf in der Mitte aufgerufen.

3. Damit der Rest des Codes am Seitenende geladen wird, muss in der "/templates/xt5/source/boxes.php" vor der Zeile:

 $smarty->assign('tpl_path','templates/'.CURRENT_TEMPLATE.'/');

folgendes geschrieben werden:

 $GOOGLE_ANALYTICS =
  '<script type="text/javascript">

    (function() {
      var ga = document.createElement(\'script\'); ga.type = \'text/javascript\'; ga.async = true;
      ga.src = (\'https:\' == document.location.protocol ? \'https://ssl\' : \'http://www\') + \'.google-analytics.com/ga.js\';
      var s = document.getElementsByTagName(\'script\')[0]; s.parentNode.insertBefore(ga, s);
    })();

   </script>';
   $smarty->assign('GOOGLE_ANALYTICS', $GOOGLE_ANALYTICS);

4. Zum Schluss muss noch in der "/templates/xt5/index.html" ganz unten

 {$GOOGLE_ANALYTICS}

rein.

Nun sollte Google Analytics funktionieren.