diff --git a/www/google101961860538784e.html b/www/google101961860538784e.html new file mode 100644 index 0000000..ea2f95f --- /dev/null +++ b/www/google101961860538784e.html @@ -0,0 +1 @@ +google-site-verification: google101961860538784e.html diff --git a/www/modules/advpicto/views/templates/hook/product-list.tpl b/www/modules/advpicto/views/templates/hook/product-list.tpl index 624f2e2..0ecc40c 100644 --- a/www/modules/advpicto/views/templates/hook/product-list.tpl +++ b/www/modules/advpicto/views/templates/hook/product-list.tpl @@ -2,7 +2,7 @@ {foreach from=$pictos item=picto name=picto}
  • {if $picto.hasImg} - {$picto.title} + {$picto.title} {/if}
    @@ -14,4 +14,4 @@
  • {/foreach} -{/if} \ No newline at end of file +{/if} diff --git a/www/modules/advpicto/views/templates/hook/product.tpl b/www/modules/advpicto/views/templates/hook/product.tpl index 5dbdee0..6260935 100644 --- a/www/modules/advpicto/views/templates/hook/product.tpl +++ b/www/modules/advpicto/views/templates/hook/product.tpl @@ -3,7 +3,7 @@ {foreach from=$pictos item=picto name=picto}
  • {if $picto.hasImg} - {$picto.title} + {$picto.title} {/if}
    @@ -16,4 +16,4 @@
  • {/foreach} -{/if} \ No newline at end of file +{/if} diff --git a/www/modules/ganalytics/.gitmodules b/www/modules/ganalytics/.gitmodules new file mode 100755 index 0000000..a7ebb41 --- /dev/null +++ b/www/modules/ganalytics/.gitmodules @@ -0,0 +1,3 @@ +[submodule "backward_compatibility"] + path = backward_compatibility + url = https://github.com/PrestaShop/PrestaShop-backward_compatibility.git diff --git a/www/modules/ganalytics/Readme.md b/www/modules/ganalytics/Readme.md new file mode 100755 index 0000000..59b4bd8 --- /dev/null +++ b/www/modules/ganalytics/Readme.md @@ -0,0 +1,40 @@ +![alt tag](views/img/ga_logo.png) + +## About + +Gain clear insights into important metrics about your customers, using Google Analytics. + +## Contributing + +PrestaShop modules are open-source extensions to the PrestaShop e-commerce solution. Everyone is welcome and even encouraged to contribute with their own improvements. + +Google Analytics is compatible with all versions of PrestaShop 1.4, 1.5 and 1.6. + +### Requirements + +Contributors **must** follow the following rules: + +* **Make your Pull Request on the "dev" branch**, NOT the "master" branch. +* Do NOT update the module's version number. +* Follow [the coding standards][1]. + +### Process in details + +Contributors wishing to edit a module's files should follow the following process: + +1. Create your GitHub account, if you do not have one already. +2. Fork the ganalytics project to your GitHub account. +3. Clone your fork to your local machine in the ```/modules``` directory of your PrestaShop installation. +4. Create a branch in your local clone of the module for your changes. +5. Change the files in your branch. Be sure to follow [the coding standards][1]! +6. Push your changed branch to your fork in your GitHub account. +7. Create a pull request for your changes **on the _'dev'_ branch** of the module's project. Be sure to follow [the commit message norm][2] in your pull request. If you need help to make a pull request, read the [Github help page about creating pull requests][3]. +8. Wait for one of the core developers either to include your change in the codebase, or to comment on possible improvements you should make to your code. + +That's it: you have contributed to this open-source project! Congratulations! + +[1]: http://doc.prestashop.com/display/PS16/Coding+Standards +[2]: http://doc.prestashop.com/display/PS16/How+to+write+a+commit+message +[3]: https://help.github.com/articles/using-pull-requests + + diff --git a/www/modules/ganalytics/controllers/admin/AdminGanalyticsAjax.php b/www/modules/ganalytics/controllers/admin/AdminGanalyticsAjax.php new file mode 100755 index 0000000..0212045 --- /dev/null +++ b/www/modules/ganalytics/controllers/admin/AdminGanalyticsAjax.php @@ -0,0 +1,42 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AdminGanalyticsAjaxController extends ModuleAdminController +{ + public $ssl = true; + + public function init() + { + $order = new Order((int)Tools::getValue('orderid')); + $context = Context::getContext(); + if (Validate::isLoadedObject($order) && (isset($context->employee->id) && $context->employee->id)) + { + Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'ganalytics` SET sent = 1, date_add = NOW() WHERE id_order = '.(int)Tools::getValue('orderid')); + die('OK'); + } + die('KO'); + } +} diff --git a/www/modules/ganalytics/controllers/admin/index.php b/www/modules/ganalytics/controllers/admin/index.php new file mode 100755 index 0000000..041b9eb --- /dev/null +++ b/www/modules/ganalytics/controllers/admin/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/www/modules/ganalytics/controllers/front/ajax.php b/www/modules/ganalytics/controllers/front/ajax.php new file mode 100755 index 0000000..d6c769f --- /dev/null +++ b/www/modules/ganalytics/controllers/front/ajax.php @@ -0,0 +1,43 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class GanalyticsAjaxModuleFrontController extends ModuleFrontController +{ + public $ssl = true; + /* + * @see FrontController::initContent() + */ + public function initContent() + { + parent::initContent(); + + $order = new Order((int)Tools::getValue('orderid')); + if (!Validate::isLoadedObject($order) || $order->id_customer != (int)Tools::getValue('customer')) + die; + Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'ganalytics` SET sent = 1, date_add = NOW() WHERE id_order = '.(int)Tools::getValue('orderid').' LIMIT 1'); + die; + } +} diff --git a/www/modules/ganalytics/controllers/front/index.php b/www/modules/ganalytics/controllers/front/index.php new file mode 100755 index 0000000..041b9eb --- /dev/null +++ b/www/modules/ganalytics/controllers/front/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/www/modules/ganalytics/controllers/index.php b/www/modules/ganalytics/controllers/index.php new file mode 100755 index 0000000..041b9eb --- /dev/null +++ b/www/modules/ganalytics/controllers/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/www/modules/ganalytics/de.php b/www/modules/ganalytics/de.php new file mode 100755 index 0000000..c53f073 --- /dev/null +++ b/www/modules/ganalytics/de.php @@ -0,0 +1,49 @@ +ganalytics_7510f8b22dd3e10476096425f78d4239'] = 'Sie haben Ihre Google Analytics-ID noch nicht eingestellt'; +$_MODULE['<{ganalytics}prestashop>ganalytics_aba1a7971f85c725ba4aed21343eeb4b'] = 'Integrieren Sie das Google Analytics-Skript in Ihren Shop'; +$_MODULE['<{ganalytics}prestashop>ganalytics_fa214007826415a21a8456e3e09f999d'] = 'Sie sind sicher, dass Sie Ihre Daten löschen wollen?'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; +$_MODULE['<{ganalytics}prestashop>ganalytics_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d7c9ce3337a28d63ce6626d90fdaedaa'] = 'Ihr Benutzername'; +$_MODULE['<{ganalytics}prestashop>ganalytics_81eeab9506186e2dca8faefa78d54067'] = 'Beispiel:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a3e7f361e6fc12caf872119338642143'] = ' ID aktualisieren'; +$_MODULE['<{ganalytics}prestashop>ganalytics_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Hilfe'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d78b0fcff6b55bafe615f3fc1572c282'] = 'Der erste Schritt zum Erfassen von E-Commerce-Transaktionen ist, E-Commerce-Berichte für das Profil Ihrer Website zu aktivieren.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d02388589ecfd3b58e0a90e42127ca61'] = 'Bitte folgen Sie diesen Schritten, um die E-Commerce-Bereichte zu aktivieren:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_11f4b4ba23dc72ee5e86ff5a90bdde60'] = 'Melden Sie sich bei Ihrem Konto an'; +$_MODULE['<{ganalytics}prestashop>ganalytics_b452493b16ead8b4b25ab3fb7174b8f5'] = 'Klicken Sie auf Bearbeiten neben dem Profil, das Sie aktivieren möchten'; +$_MODULE['<{ganalytics}prestashop>ganalytics_95df6d8c97e880d8f6895d824d72c353'] = 'Klicken Sie auf der Seite Profileinstellungen auf Bearbeiten neben der Hauptwebseiten-Profilinformation'; +$_MODULE['<{ganalytics}prestashop>ganalytics_5189c0be0481408c9301c377818e69dc'] = 'Drehen Sie den Radioknopf der E-Commerce-Webseite von Nein auf Ja'; +$_MODULE['<{ganalytics}prestashop>ganalytics_98d12a01ab2aeeb10b7100eecf1974a8'] = 'Geben Sie Ihre Ziel-Informationen ein, um Ihre Ziele einzustellen:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a44698a775d2fec04549ba6a2ac00491'] = 'Zurück zu Ihrer persönlichen Startseite'; +$_MODULE['<{ganalytics}prestashop>ganalytics_dbec126ee3be2cd285a32a8d413fd1fa'] = 'Suchen Sie das Profil, für das Sie ein Ziel erstellen möchten, klicken Sie dann auf Bearbeiten'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c4af40d39b97cf98040540639841e27a'] = 'Wählen Sie eine der 4 verfügbaren Zielpositionen für dieses Profil und klicken dann auf \"Bearbeiten\"'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c3b99aa9b4638183dc1bf55f955ed9ae'] = 'Geben Sie die Ziel-URL ein. Das Erreichen dieser Seite ist ein Zeichen für eine erfolgreiche Umwandlung'; +$_MODULE['<{ganalytics}prestashop>ganalytics_54849fd1a3b8bdde81bfd979bc43aaa9'] = 'Geben Sie den Zielnamen ein, wie er in Ihrem Google Analytics-Konto angezeigt werden soll'; +$_MODULE['<{ganalytics}prestashop>ganalytics_62034d209119c06315f59a5de39c6717'] = 'Aktivieren Sie das Ziel'; +$_MODULE['<{ganalytics}prestashop>ganalytics_792795e7f3cedd66897ca35349101ba8'] = 'Dann definieren Sie mit den folgenden Schritten einen Trichter:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_467ed594f2aa9b3e802037a10bad61b1'] = 'Geben Sie die URL der ersten Seite Ihres Umwandlungstrichters ein. Dies sollte allen Nutzern vertraut sein, die auf Ihr Ziel zugehen.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_2edf3f56ba30ad663429ba0e812a2396'] = 'Geben Sie einen Namen für diesen Schritt ein.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c909bea215f88ff0de9888dc95eed1ca'] = 'Wenn dieser Schritt erforderlich für die Umwandlung ist, klicken Sie das Kontrollkästchen rechts von diesem Schritt an.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9d25cb4b66791343ca319b3cdb82dba6'] = 'Geben Sie weitere Zielschritte ein, bis Ihr Trichter vollständig definiert ist. Sie können bis zu 10 Schritte oder auch nur einen einzigen Schritt eingeben.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_1c681b64f4cd8f52aecbb55c98f5c768'] = 'Konfigurieren Sie abschließend die Zusätzlichen Einstellungen durch die folgenden Schritte unten:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_bb1ca9cfa0f3f7dbd06a2364c9a0dc9c'] = 'Wenn die oben angegebenen URLs die Groß-/Kleinschreibung berücksichtigen, markieren Sie das Kontrollkästchen.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_047cf7562621a3639b3e04a63dc6b41f'] = 'Wählen Sie den entsprechenden Ziel-Übereinstimmungstyp. ('; +$_MODULE['<{ganalytics}prestashop>ganalytics_d59048f21fd887ad520398ce677be586'] = 'Erfahren Sie mehr'; +$_MODULE['<{ganalytics}prestashop>ganalytics_f0c5b61aabf16d5ce925722b65c9aad8'] = 'über Übereinstimmungstypen und wie den entsprechenden Ziel-Übereinstimmungstyp für Ihr Ziel wählen können.)'; +$_MODULE['<{ganalytics}prestashop>ganalytics_3dcb5dddc6b7c11d4ea76a60dc1a0466'] = 'Geben Sie einen Zielwert ein. Dies ist der Wert, der in den Google Analytics ROI-Berechnungen verwendet wird.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a39f026ca75c6279ac9487265c00e3f5'] = 'Klicken Sie auf Änderungen speichern, um dieses Ziel und diesen Trichter zu erstellen , oder Abbrechen, um ohne Speichern zu beenden.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_cd4952b65560a1242c68ffc980a6e515'] = 'Demonstration: Der Bestellvorgang'; +$_MODULE['<{ganalytics}prestashop>ganalytics_efbf206b1b60cc0400c6147723509bd6'] = 'Nachdem Sie Ihre E-Commerce-Berichte aktiviert und das jeweilige Profil ausgewählt haben, geben Sie \'bestellung-bestätigung.php\' ein, als gewünschte URL-Seite'; +$_MODULE['<{ganalytics}prestashop>ganalytics_68db264effa9364901183d9d12fac500'] = 'Dieses Ziel benennen (zum Beispiel \'Bestellvorgang\')'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9b8bc3519c65da8fac122f91ac5b7673'] = 'Aktivieren Sie das Ziel'; +$_MODULE['<{ganalytics}prestashop>ganalytics_86a358dd6df1ba0cb3565b88380ba7a6'] = 'Fügen Sie \'product.php\' als erste Seite Ihres Umwandlungstrichters hinzu'; +$_MODULE['<{ganalytics}prestashop>ganalytics_b7f896191caad09b5fc34e79f1cefa76'] = 'Benennen Sie sie (zum Beispiel \'Produktseite\')'; +$_MODULE['<{ganalytics}prestashop>ganalytics_ef7060dd05e779dcfbf82f236df43823'] = 'Markieren Sie das Kontrollkästchen nicht als \"erforderlich\", denn der Kunde kann direkt von einer \"In den Warenkorb\"-Schaltfläche gekommen sein wie etwa auf dem Startseitenblock '; +$_MODULE['<{ganalytics}prestashop>ganalytics_3bab28a0105361c49ca261ca08a19bf7'] = 'Fahren Sie fort, indem Sie die folgenden URLs als Zielschritte eingeben:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9bfb6e6af6e6793bfa9387e728187c87'] = '(Erforderlich)'; +$_MODULE['<{ganalytics}prestashop>ganalytics_6a47891ae07f45802bc948d2618e36f5'] = 'Überprüfen Sie die \'Groß-/Kleinschreibung\'-Option'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d2d0c38d112e1d775057388122ae7545'] = 'Speichern Sie dieses neue Ziel'; diff --git a/www/modules/ganalytics/es.php b/www/modules/ganalytics/es.php new file mode 100755 index 0000000..30cbf51 --- /dev/null +++ b/www/modules/ganalytics/es.php @@ -0,0 +1,49 @@ +ganalytics_7510f8b22dd3e10476096425f78d4239'] = 'Aún no ha configurado su ID de Google Analytics'; +$_MODULE['<{ganalytics}prestashop>ganalytics_aba1a7971f85c725ba4aed21343eeb4b'] = 'Integrar el script de Google Analytics en su tienda'; +$_MODULE['<{ganalytics}prestashop>ganalytics_fa214007826415a21a8456e3e09f999d'] = '¿Está seguro de querer eliminar todos sus datos?'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c888438d14855d7d96a2724ee9c306bd'] = 'Configuración actualizada'; +$_MODULE['<{ganalytics}prestashop>ganalytics_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuración'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d7c9ce3337a28d63ce6626d90fdaedaa'] = 'Su nombre de usuario'; +$_MODULE['<{ganalytics}prestashop>ganalytics_81eeab9506186e2dca8faefa78d54067'] = 'Ejemplo:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a3e7f361e6fc12caf872119338642143'] = 'Actualizar ID'; +$_MODULE['<{ganalytics}prestashop>ganalytics_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Ayuda'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d78b0fcff6b55bafe615f3fc1572c282'] = 'El primer paso para seguir las transacciones de comercio electrónico es activar el informe de su tienda en su perfil.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d02388589ecfd3b58e0a90e42127ca61'] = 'Para activar el informe de comercio electrónico, por favor revise estos pasos:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_11f4b4ba23dc72ee5e86ff5a90bdde60'] = 'Entrar en su cuenta'; +$_MODULE['<{ganalytics}prestashop>ganalytics_b452493b16ead8b4b25ab3fb7174b8f5'] = 'Haga clic en Editar en el perfil que quiere activar'; +$_MODULE['<{ganalytics}prestashop>ganalytics_95df6d8c97e880d8f6895d824d72c353'] = 'En la página de Configuración del Perfil, haga clic en \\\"Editar\\\" para el Perfil de Información de la Web Principal'; +$_MODULE['<{ganalytics}prestashop>ganalytics_5189c0be0481408c9301c377818e69dc'] = 'seleccione sí/no en Web de comercio electrónico'; +$_MODULE['<{ganalytics}prestashop>ganalytics_98d12a01ab2aeeb10b7100eecf1974a8'] = 'Para configurar sus objetivos, introduzca información sobre ellos:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a44698a775d2fec04549ba6a2ac00491'] = 'Volver a la página principal de su cuenta'; +$_MODULE['<{ganalytics}prestashop>ganalytics_dbec126ee3be2cd285a32a8d413fd1fa'] = 'Encuentra el perfil del objetivo que quieres crear, y pulsa \\\"Editar\\\"'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c4af40d39b97cf98040540639841e27a'] = 'Seleccione uno de los cuatro objetivos disponibles para su perfil, después haga clic en Edit'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c3b99aa9b4638183dc1bf55f955ed9ae'] = 'Introduzca la URL objetivo. Acceder a esta página generará una conversión correcta'; +$_MODULE['<{ganalytics}prestashop>ganalytics_54849fd1a3b8bdde81bfd979bc43aaa9'] = 'Introduzca el nombre del objetivo tal como aparece en su cuenta Google Analytics'; +$_MODULE['<{ganalytics}prestashop>ganalytics_62034d209119c06315f59a5de39c6717'] = 'Activar el objetivo'; +$_MODULE['<{ganalytics}prestashop>ganalytics_792795e7f3cedd66897ca35349101ba8'] = 'Después, defina un redireccionamiento siguiendo estos pasos:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_467ed594f2aa9b3e802037a10bad61b1'] = 'Introduzca la URL de la primera página de su redireccionamiento de conversión. Esta página deberá ser común para todos los usuarios hacia su objetivo.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_2edf3f56ba30ad663429ba0e812a2396'] = 'Introduzca un nombre para este paso'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c909bea215f88ff0de9888dc95eed1ca'] = 'Si este paso es necesario en el proceso de conversión, seleccione la casilla de la derecha del paso.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9d25cb4b66791343ca319b3cdb82dba6'] = 'Continue avanzando hasta completar el objetivo. Debe introducir de 1 a 10 etapas.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_1c681b64f4cd8f52aecbb55c98f5c768'] = 'Para terminar, configure los parámetros complementarios para continuar los siguientes pasos: '; +$_MODULE['<{ganalytics}prestashop>ganalytics_bb1ca9cfa0f3f7dbd06a2364c9a0dc9c'] = 'Si las URLs introducidas arriba distinguen entre mayúsculas y minúsculas, marque la casilla de verificación.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_047cf7562621a3639b3e04a63dc6b41f'] = 'Seleccione el objetivo apropiado. ('; +$_MODULE['<{ganalytics}prestashop>ganalytics_d59048f21fd887ad520398ce677be586'] = 'Más información'; +$_MODULE['<{ganalytics}prestashop>ganalytics_f0c5b61aabf16d5ce925722b65c9aad8'] = 'sobre los Tipos de Partidos y sobre la manera de elegir el tipo de correspondencia adecuada a su objetivo.)'; +$_MODULE['<{ganalytics}prestashop>ganalytics_3dcb5dddc6b7c11d4ea76a60dc1a0466'] = 'Introduzca un valor objetivo. Este es el valor utilizado para los cáculos de Google Analitics.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a39f026ca75c6279ac9487265c00e3f5'] = 'Haga clic en \\\"Salvar cambios\\\" para crear este objetivo, o cancelar para salir sin guardar cambios.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_cd4952b65560a1242c68ffc980a6e515'] = 'Demostración: El proceso de pedido'; +$_MODULE['<{ganalytics}prestashop>ganalytics_efbf206b1b60cc0400c6147723509bd6'] = 'Después de activar sus informes sobre e-commerce y de seleccionar el perfil, introduzca \'order-confirmation.php\' como la página URL de destino'; +$_MODULE['<{ganalytics}prestashop>ganalytics_68db264effa9364901183d9d12fac500'] = 'Nombre del objetivo (por ejemplo \\\"proceso del pedido\\\")'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9b8bc3519c65da8fac122f91ac5b7673'] = 'Activar el objetivo'; +$_MODULE['<{ganalytics}prestashop>ganalytics_86a358dd6df1ba0cb3565b88380ba7a6'] = 'Añadir \'producto.php\' como la primera página de redireccionamiento'; +$_MODULE['<{ganalytics}prestashop>ganalytics_b7f896191caad09b5fc34e79f1cefa76'] = 'Dele un nombre (por ejemplo \\\"Página del producto\\\")'; +$_MODULE['<{ganalytics}prestashop>ganalytics_ef7060dd05e779dcfbf82f236df43823'] = 'No marque \\\"obligatorio\\\" porque el cliente deberá visitar desde el botón \\\"Añadir al carrito\\\" como en el homefeatured de producto de la página de inicio.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_3bab28a0105361c49ca261ca08a19bf7'] = 'Continúe introduciendo las siguientes URL como objetivos:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9bfb6e6af6e6793bfa9387e728187c87'] = '(obligatorio)'; +$_MODULE['<{ganalytics}prestashop>ganalytics_6a47891ae07f45802bc948d2618e36f5'] = 'Revise la opción de \\\"distinción mayúsculas-minúsculas\\\"'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d2d0c38d112e1d775057388122ae7545'] = 'Guardar este nuevo objetivo'; diff --git a/www/modules/ganalytics/fr.php b/www/modules/ganalytics/fr.php new file mode 100755 index 0000000..a9c594c --- /dev/null +++ b/www/modules/ganalytics/fr.php @@ -0,0 +1,49 @@ +ganalytics_7510f8b22dd3e10476096425f78d4239'] = 'Vous n\'avez pas encore renseigné votre ID Google Analytics'; +$_MODULE['<{ganalytics}prestashop>ganalytics_aba1a7971f85c725ba4aed21343eeb4b'] = 'Intègre le script de Google Analytics à votre boutique'; +$_MODULE['<{ganalytics}prestashop>ganalytics_fa214007826415a21a8456e3e09f999d'] = 'Etes-vous sûr de vouloir supprimer vos paramètres ?'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres mis à jour'; +$_MODULE['<{ganalytics}prestashop>ganalytics_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d7c9ce3337a28d63ce6626d90fdaedaa'] = 'Votre identifiant'; +$_MODULE['<{ganalytics}prestashop>ganalytics_81eeab9506186e2dca8faefa78d54067'] = 'Exemple :'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a3e7f361e6fc12caf872119338642143'] = 'Enregistrer l\'identifiant'; +$_MODULE['<{ganalytics}prestashop>ganalytics_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Aide'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d78b0fcff6b55bafe615f3fc1572c282'] = 'La première étape pour analyser les transactions e-commerce consiste à activer l\'archivage sur le profil de votre site.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d02388589ecfd3b58e0a90e42127ca61'] = 'Pour activer l\'option e-commerce, suivez ces étapes :'; +$_MODULE['<{ganalytics}prestashop>ganalytics_11f4b4ba23dc72ee5e86ff5a90bdde60'] = 'Connectez-vous à votre compte'; +$_MODULE['<{ganalytics}prestashop>ganalytics_b452493b16ead8b4b25ab3fb7174b8f5'] = 'Cliquez sur Edit, à côté du profil que vous désirez activer'; +$_MODULE['<{ganalytics}prestashop>ganalytics_95df6d8c97e880d8f6895d824d72c353'] = 'Sur la page \"Paramètres des profils\", cliquez sur \"Modifier\" en regard de l\'option \"Informations sur le profil du site principal\"'; +$_MODULE['<{ganalytics}prestashop>ganalytics_5189c0be0481408c9301c377818e69dc'] = 'Modifiez le bouton radio \"E-commerce\" sur \"Oui\"'; +$_MODULE['<{ganalytics}prestashop>ganalytics_98d12a01ab2aeeb10b7100eecf1974a8'] = 'Afin de définir vos objectifs, saisissez les informations de l\'objectif :'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a44698a775d2fec04549ba6a2ac00491'] = 'Retournez sur la page d\'accueil de votre compte'; +$_MODULE['<{ganalytics}prestashop>ganalytics_dbec126ee3be2cd285a32a8d413fd1fa'] = 'Trouvez le profil correspondant à l\'objectif et éditez-le'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c4af40d39b97cf98040540639841e27a'] = 'Sélectionnez un des 4 emplacements disponibles pour ce profil et cliquez sur Editer'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c3b99aa9b4638183dc1bf55f955ed9ae'] = 'Entrez l\'URL de la page d\'objectif. Une conversion est enregistrée chaque fois qu\'un visiteur accède à cette page'; +$_MODULE['<{ganalytics}prestashop>ganalytics_54849fd1a3b8bdde81bfd979bc43aaa9'] = 'Entrez le nom de l\'objectif tel qu\'il doit apparaître dans votre compte Google Analytics.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_62034d209119c06315f59a5de39c6717'] = 'Activez l\'objectif'; +$_MODULE['<{ganalytics}prestashop>ganalytics_792795e7f3cedd66897ca35349101ba8'] = 'Ensuite, définissez un entonnoir de conversion en suivant ces étapes :'; +$_MODULE['<{ganalytics}prestashop>ganalytics_467ed594f2aa9b3e802037a10bad61b1'] = 'Entrez l\'URL de la première page de votre entonnoir de conversion. Cette page doit être commune à tous les internautes que vous souhaitez amener jusqu\'à votre objectif'; +$_MODULE['<{ganalytics}prestashop>ganalytics_2edf3f56ba30ad663429ba0e812a2396'] = 'Attribuez un nom à cette étape.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c909bea215f88ff0de9888dc95eed1ca'] = 'Si cette étape est obligatoire dans l\'objectif, cochez la case à droite de cette étape.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9d25cb4b66791343ca319b3cdb82dba6'] = 'Entrez toutes les étapes précédant l\'objectif jusqu\'à ce que vous ayez terminé de définir l\'entonnoir de conversion. Vous pouvez entrer de 1 à 10 étapes'; +$_MODULE['<{ganalytics}prestashop>ganalytics_1c681b64f4cd8f52aecbb55c98f5c768'] = 'Pour finir, configurez les Paramètres complémentaires en procédant comme suit :'; +$_MODULE['<{ganalytics}prestashop>ganalytics_bb1ca9cfa0f3f7dbd06a2364c9a0dc9c'] = 'Si les URL entrées ci-dessus sont sensibles à la casse, cochez la case.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_047cf7562621a3639b3e04a63dc6b41f'] = 'Sélectionnez l\'objectif approprié. ('; +$_MODULE['<{ganalytics}prestashop>ganalytics_d59048f21fd887ad520398ce677be586'] = 'En savoir plus'; +$_MODULE['<{ganalytics}prestashop>ganalytics_f0c5b61aabf16d5ce925722b65c9aad8'] = 'sur les types de correspondances et sur la façon de choisir le type de correspondance approprié à votre objectif)'; +$_MODULE['<{ganalytics}prestashop>ganalytics_3dcb5dddc6b7c11d4ea76a60dc1a0466'] = 'Entrez un objectif. Cette valeur est utilisée par les calculs ROI de Google Analytics.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a39f026ca75c6279ac9487265c00e3f5'] = 'Cliquez sur Enregistrer les modifications pour créer cet objectif et cet entonnoir de conversion ou sur Annuler pour quitter sans enregistrer.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_cd4952b65560a1242c68ffc980a6e515'] = 'Démonstration : Le processus de commande'; +$_MODULE['<{ganalytics}prestashop>ganalytics_efbf206b1b60cc0400c6147723509bd6'] = 'Après avoir activé vos reports e-commerce et sélectionné les profils respectifs, entrez \'order-confirmation.php\' comme page cible.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_68db264effa9364901183d9d12fac500'] = 'Nommez cet objectif (par exemple \'Processus de commande\')'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9b8bc3519c65da8fac122f91ac5b7673'] = 'Activez l\'objectif'; +$_MODULE['<{ganalytics}prestashop>ganalytics_86a358dd6df1ba0cb3565b88380ba7a6'] = 'Ajoutez \'product.php\' comme la première page du cheminement de vos visiteurs'; +$_MODULE['<{ganalytics}prestashop>ganalytics_b7f896191caad09b5fc34e79f1cefa76'] = 'Donnez lui un nom (par exemple \'Page produit\')'; +$_MODULE['<{ganalytics}prestashop>ganalytics_ef7060dd05e779dcfbf82f236df43823'] = 'N\'activez pas la case \'requis\' parce que les clients pourraient visiter directement par un bouton \'Ajouter au panier\', tel que dans le module HomeFeatured sur la page d\'accueil.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_3bab28a0105361c49ca261ca08a19bf7'] = 'Faites de même en entrant les urls suivantes comme étapes de l\'objectif'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9bfb6e6af6e6793bfa9387e728187c87'] = 'requis'; +$_MODULE['<{ganalytics}prestashop>ganalytics_6a47891ae07f45802bc948d2618e36f5'] = 'Vérifiez l\'option \'sensibilité de la casse\''; +$_MODULE['<{ganalytics}prestashop>ganalytics_d2d0c38d112e1d775057388122ae7545'] = 'Sauvegardez cet objectif'; diff --git a/www/modules/ganalytics/ganalytics.php b/www/modules/ganalytics/ganalytics.php new file mode 100755 index 0000000..36d71ea --- /dev/null +++ b/www/modules/ganalytics/ganalytics.php @@ -0,0 +1,871 @@ + + * @copyright 2007-2015 PrestaShop SA + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + * International Registered Trademark & Property of PrestaShop SA + */ + +if (!defined('_PS_VERSION_')) + exit; + +class Ganalytics extends Module +{ + protected $js_state = 0; + protected $eligible = 0; + protected $filterable = 1; + protected static $products = array(); + protected $_debug = 0; + + public function __construct() + { + $this->name = 'ganalytics'; + $this->tab = 'analytics_stats'; + $this->version = '2.3.4'; + $this->author = 'PrestaShop'; + $this->module_key = 'fd2aaefea84ac1bb512e6f1878d990b8'; + $this->bootstrap = true; + + parent::__construct(); + + $this->displayName = $this->l('Google Analytics'); + $this->description = $this->l('Gain clear insights into important metrics about your customers, using Google Analytics'); + $this->confirmUninstall = $this->l('Are you sure you want to uninstall Google Analytics? You will lose all the data related to this module.'); + /* Backward compatibility */ + if (version_compare(_PS_VERSION_, '1.5', '<')) + require(_PS_MODULE_DIR_.$this->name.'/backward_compatibility/backward.php'); + + $this->checkForUpdates(); + } + + public function install() + { + if (version_compare(_PS_VERSION_, '1.5', '>=') && Shop::isFeatureActive()) + Shop::setContext(Shop::CONTEXT_ALL); + + if (!parent::install() || !$this->installTab() || !$this->registerHook('header') || !$this->registerHook('adminOrder') + || !$this->registerHook('footer') || !$this->registerHook('home') + || !$this->registerHook('productfooter') || !$this->registerHook('orderConfirmation') + || !$this->registerHook('backOfficeHeader')) + return false; + + if (version_compare(_PS_VERSION_, '1.5', '>=') + && (!$this->registerHook('actionProductCancel') || !$this->registerHook('actionCartSave'))) + return false; + + Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'ganalytics`'); + + if (!Db::getInstance()->Execute(' + CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'ganalytics` ( + `id_google_analytics` int(11) NOT NULL AUTO_INCREMENT, + `id_order` int(11) NOT NULL, + `id_customer` int(10) NOT NULL, + `id_shop` int(11) NOT NULL, + `sent` tinyint(1) DEFAULT NULL, + `date_add` datetime DEFAULT NULL, + PRIMARY KEY (`id_google_analytics`), + KEY `id_order` (`id_order`), + KEY `sent` (`sent`) + ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8 AUTO_INCREMENT=1')) + return $this->uninstall(); + + return true; + } + + public function uninstall() + { + if (!$this->uninstallTab() || !parent::uninstall()) + return false; + + return Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'ganalytics`'); + } + + public function installTab() + { + if (version_compare(_PS_VERSION_, '1.5', '<')) + return true; + + $tab = new Tab(); + $tab->active = 0; + $tab->class_name = 'AdminGanalyticsAjax'; + $tab->name = array(); + foreach (Language::getLanguages(true) as $lang) + $tab->name[$lang['id_lang']] = 'Google Analytics Ajax'; + $tab->id_parent = -1; //(int)Tab::getIdFromClassName('AdminAdmin'); + $tab->module = $this->name; + return $tab->add(); + } + + public function uninstallTab() + { + if (version_compare(_PS_VERSION_, '1.5', '<')) + return true; + + $id_tab = (int)Tab::getIdFromClassName('AdminGanalyticsAjax'); + if ($id_tab) + { + $tab = new Tab($id_tab); + return $tab->delete(); + } + + return true; + } + + public function displayForm() + { + // Get default language + $default_lang = (int)Configuration::get('PS_LANG_DEFAULT'); + + $helper = new HelperForm(); + + // Module, token and currentIndex + $helper->module = $this; + $helper->name_controller = $this->name; + $helper->token = Tools::getAdminTokenLite('AdminModules'); + $helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name; + + // Language + $helper->default_form_language = $default_lang; + $helper->allow_employee_form_lang = $default_lang; + + // Title and toolbar + $helper->title = $this->displayName; + $helper->show_toolbar = true; // false -> remove toolbar + $helper->toolbar_scroll = true; // yes - > Toolbar is always visible on the top of the screen. + $helper->submit_action = 'submit'.$this->name; + $helper->toolbar_btn = array( + 'save' => + array( + 'desc' => $this->l('Save'), + 'href' => AdminController::$currentIndex.'&configure='.$this->name.'&save'.$this->name. + '&token='.Tools::getAdminTokenLite('AdminModules'), + ), + 'back' => array( + 'href' => AdminController::$currentIndex.'&token='.Tools::getAdminTokenLite('AdminModules'), + 'desc' => $this->l('Back to list') + ) + ); + + $fields_form = array(); + // Init Fields form array + $fields_form[0]['form'] = array( + 'legend' => array( + 'title' => $this->l('Settings'), + ), + 'input' => array( + array( + 'type' => 'text', + 'label' => $this->l('Google Analytics Tracking ID'), + 'name' => 'GA_ACCOUNT_ID', + 'size' => 20, + 'required' => true, + 'hint' => $this->l('This information is available in your Google Analytics account') + ), + array( + 'type' => 'radio', + 'label' => $this->l('Enable User ID tracking'), + 'name' => 'GA_USERID_ENABLED', + 'hint' => $this->l('The User ID is set at the property level. To find a property, click Admin, then select an account and a property. From the Property column, click Tracking Info then User ID'), + 'values' => array( + array( + 'id' => 'ga_userid_enabled', + 'value' => 1, + 'label' => $this->l('Enabled') + ), + array( + 'id' => 'ga_userid_disabled', + 'value' => 0, + 'label' => $this->l('Disabled') + ), + ), + ), + ), + 'submit' => array( + 'title' => $this->l('Save'), + ) + ); + + // Load current value + $helper->fields_value['GA_ACCOUNT_ID'] = Configuration::get('GA_ACCOUNT_ID'); + $helper->fields_value['GA_USERID_ENABLED'] = Configuration::get('GA_USERID_ENABLED'); + + return $helper->generateForm($fields_form); + } + + /** + * back office module configuration page content + */ + public function getContent() + { + $output = ''; + if (Tools::isSubmit('submit'.$this->name)) + { + $ga_account_id = Tools::getValue('GA_ACCOUNT_ID'); + if (!empty($ga_account_id)) + { + Configuration::updateValue('GA_ACCOUNT_ID', $ga_account_id); + Configuration::updateValue('GANALYTICS_CONFIGURATION_OK', true); + $output .= $this->displayConfirmation($this->l('Account ID updated successfully')); + } + $ga_userid_enabled = Tools::getValue('GA_USERID_ENABLED'); + if (null !== $ga_userid_enabled) + { + Configuration::updateValue('GA_USERID_ENABLED', (bool)$ga_userid_enabled); + $output .= $this->displayConfirmation($this->l('Settings for User ID updated successfully')); + } + } + + if (version_compare(_PS_VERSION_, '1.5', '>=')) + $output .= $this->displayForm(); + else + { + $this->context->smarty->assign(array( + 'account_id' => Configuration::get('GA_ACCOUNT_ID'), + )); + $output .= $this->display(__FILE__, 'views/templates/admin/form-ps14.tpl'); + } + + return $this->display(__FILE__, 'views/templates/admin/configuration.tpl').$output; + } + + protected function _getGoogleAnalyticsTag($back_office = false) + { + $user_id = null; + if (Configuration::get('GA_USERID_ENABLED') && + $this->context->customer && $this->context->customer->isLogged() + ){ + $user_id = (int)$this->context->customer->id; + } + + return ' + '; + } + + public function hookHeader() + { + if (Configuration::get('GA_ACCOUNT_ID')) + { + $this->context->controller->addJs($this->_path.'views/js/GoogleAnalyticActionLib.js'); + + return $this->_getGoogleAnalyticsTag(); + } + } + + /** + * Return a detailed transaction for Google Analytics + */ + public function wrapOrder($id_order) + { + $order = new Order((int)$id_order); + + if (Validate::isLoadedObject($order)) + return array( + 'id' => $id_order, + 'affiliation' => Shop::isFeatureActive() ? $this->context->shop->name : Configuration::get('PS_SHOP_NAME'), + 'revenue' => $order->total_paid, + 'shipping' => $order->total_shipping, + 'tax' => $order->total_paid_tax_incl - $order->total_paid_tax_excl, + 'url' => $this->context->link->getAdminLink('AdminGanalyticsAjax'), + 'customer' => $order->id_customer); + } + + /** + * To track transactions + */ + public function hookOrderConfirmation($params) + { + $order = $params['objOrder']; + if (Validate::isLoadedObject($order) && $order->getCurrentState() != (int)Configuration::get('PS_OS_ERROR')) + { + $ga_order_sent = Db::getInstance()->getValue('SELECT id_order FROM `'._DB_PREFIX_.'ganalytics` WHERE id_order = '.(int)$order->id); + if ($ga_order_sent === false) + { + Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'ganalytics` (id_order, id_shop, sent, date_add) VALUES ('.(int)$order->id.', '.(int)$this->context->shop->id.', 0, NOW())'); + if ($order->id_customer == $this->context->cookie->id_customer) + { + $order_products = array(); + $cart = new Cart($order->id_cart); + foreach ($cart->getProducts() as $order_product) + $order_products[] = $this->wrapProduct($order_product, array(), 0, true); + + $transaction = array( + 'id' => $order->id, + 'affiliation' => (version_compare(_PS_VERSION_, '1.5', '>=') && Shop::isFeatureActive()) ? $this->context->shop->name : Configuration::get('PS_SHOP_NAME'), + 'revenue' => $order->total_paid, + 'shipping' => $order->total_shipping, + 'tax' => $order->total_paid_tax_incl - $order->total_paid_tax_excl, + 'url' => $this->context->link->getModuleLink('ganalytics', 'ajax', array(), true), + 'customer' => $order->id_customer); + $ga_scripts = $this->addTransaction($order_products, $transaction); + + $this->js_state = 1; + return $this->_runJs($ga_scripts); + } + } + } + } + + /** + * hook footer to load JS script for standards actions such as product clicks + */ + public function hookFooter() + { + $ga_scripts = ''; + $this->js_state = 0; + + if (isset($this->context->cookie->ga_cart)) + { + $this->filterable = 0; + + $gacarts = unserialize($this->context->cookie->ga_cart); + foreach ($gacarts as $gacart) + { + if ($gacart['quantity'] > 0) + $ga_scripts .= 'MBG.addToCart('.Tools::jsonEncode($gacart).');'; + elseif ($gacart['quantity'] < 0) + { + $gacart['quantity'] = abs($gacart['quantity']); + $ga_scripts .= 'MBG.removeFromCart('.Tools::jsonEncode($gacart).');'; + } + } + unset($this->context->cookie->ga_cart); + } + + $controller_name = Tools::getValue('controller'); + $products = $this->wrapProducts($this->context->smarty->getTemplateVars('products'), array(), true); + + if ($controller_name == 'order' || $controller_name == 'orderopc') + { + $this->eligible = 1; + $step = Tools::getValue('step'); + if (empty($step)) + $step = 0; + $ga_scripts .= $this->addProductFromCheckout($products, $step); + $ga_scripts .= 'MBG.addCheckout(\''.(int)$step.'\');'; + } + + if (version_compare(_PS_VERSION_, '1.5', '<')) + { + if ($controller_name == 'orderconfirmation') + $this->eligible = 1; + } + else + { + $confirmation_hook_id = (int)Hook::getIdByName('orderConfirmation'); + if (isset(Hook::$executed_hooks[$confirmation_hook_id])) + $this->eligible = 1; + } + + if (isset($products) && count($products) && $controller_name != 'index') + { + if ($this->eligible == 0) + $ga_scripts .= $this->addProductImpression($products); + $ga_scripts .= $this->addProductClick($products); + } + + return $this->_runJs($ga_scripts); + } + + protected function filter($ga_scripts) + { + if ($this->filterable = 1) + return implode(';', array_unique(explode(';', $ga_scripts))); + + return $ga_scripts; + } + + /** + * hook home to display generate the product list associated to home featured, news products and best sellers Modules + */ + public function hookHome() + { + $ga_scripts = ''; + + // Home featured products + if ($this->isModuleEnabled('homefeatured')) + { + $category = new Category($this->context->shop->getCategory(), $this->context->language->id); + $home_featured_products = $this->wrapProducts($category->getProducts((int)Context::getContext()->language->id, 1, + (Configuration::get('HOME_FEATURED_NBR') ? (int)Configuration::get('HOME_FEATURED_NBR') : 8), 'position'), array(), true); + $ga_scripts .= $this->addProductImpression($home_featured_products).$this->addProductClick($home_featured_products); + } + + // New products + if ($this->isModuleEnabled('blocknewproducts') && (Configuration::get('PS_NB_DAYS_NEW_PRODUCT') + || Configuration::get('PS_BLOCK_NEWPRODUCTS_DISPLAY'))) + { + $new_products = Product::getNewProducts((int)$this->context->language->id, 0, (int)Configuration::get('NEW_PRODUCTS_NBR')); + $new_products_list = $this->wrapProducts($new_products, array(), true); + $ga_scripts .= $this->addProductImpression($new_products_list).$this->addProductClick($new_products_list); + } + + // Best Sellers + if ($this->isModuleEnabled('blockbestsellers') && (!Configuration::get('PS_CATALOG_MODE') + || Configuration::get('PS_BLOCK_BESTSELLERS_DISPLAY'))) + { + $ga_homebestsell_product_list = $this->wrapProducts(ProductSale::getBestSalesLight((int)$this->context->language->id, 0, 8), array(), true); + $ga_scripts .= $this->addProductImpression($ga_homebestsell_product_list).$this->addProductClick($ga_homebestsell_product_list); + } + + $this->js_state = 1; + return $this->_runJs($this->filter($ga_scripts)); + } + + /** + * hook home to display generate the product list associated to home featured, news products and best sellers Modules + */ + public function isModuleEnabled($name) + { + if (version_compare(_PS_VERSION_, '1.5', '>=')) + if(Module::isEnabled($name)) + { + $module = Module::getInstanceByName($name); + return $module->isRegisteredInHook('home'); + } + else + return false; + else + { + $module = Module::getInstanceByName($name); + return ($module && $module->active === true); + } + } + + /** + * wrap products to provide a standard products information for google analytics script + */ + public function wrapProducts($products, $extras = array(), $full = false) + { + $result_products = array(); + if (!is_array($products)) + return; + + $currency = new Currency($this->context->currency->id); + $usetax = (Product::getTaxCalculationMethod((int)$this->context->customer->id) != PS_TAX_EXC); + + if (count($products) > 20) + $full = false; + else + $full = true; + + foreach ($products as $index => $product) + { + if ($product instanceof Product) + $product = (array)$product; + + if (!isset($product['price'])) + $product['price'] = (float)Tools::displayPrice(Product::getPriceStatic((int)$product['id_product'], $usetax), $currency); + $result_products[] = $this->wrapProduct($product, $extras, $index, $full); + } + + return $result_products; + } + + /** + * wrap product to provide a standard product information for google analytics script + */ + public function wrapProduct($product, $extras, $index = 0, $full = false) + { + $ga_product = ''; + + $variant = null; + if (isset($product['attributes_small'])) + $variant = $product['attributes_small']; + elseif (isset($extras['attributes_small'])) + $variant = $extras['attributes_small']; + + $product_qty = 1; + if (isset($extras['qty'])) + $product_qty = $extras['qty']; + elseif (isset($product['cart_quantity'])) + $product_qty = $product['cart_quantity']; + + $product_id = 0; + if (!empty($product['id_product'])) + $product_id = $product['id_product']; + else if (!empty($product['id'])) + $product_id = $product['id']; + + if (!empty($product['id_product_attribute'])) + $product_id .= '-'. $product['id_product_attribute']; + + $product_type = 'typical'; + if (isset($product['pack']) && $product['pack'] == 1) + $product_type = 'pack'; + elseif (isset($product['virtual']) && $product['virtual'] == 1) + $product_type = 'virtual'; + + if ($full) + { + $ga_product = array( + 'id' => $product_id, + 'name' => Tools::jsonEncode($product['name']), + 'category' => Tools::jsonEncode($product['category']), + 'brand' => isset($product['manufacturer_name']) ? Tools::jsonEncode($product['manufacturer_name']) : '', + 'variant' => Tools::jsonEncode($variant), + 'type' => $product_type, + 'position' => $index ? $index : '0', + 'quantity' => $product_qty, + 'list' => Tools::getValue('controller'), + 'url' => isset($product['link']) ? urlencode($product['link']) : '', + 'price' => number_format($product['price'], '2') + ); + } + else + { + $ga_product = array( + 'id' => $product_id, + 'name' => Tools::jsonEncode($product['name']) + ); + } + return $ga_product; + } + + /** + * add order transaction + */ + public function addTransaction($products, $order) + { + if (!is_array($products)) + return; + + $js = ''; + foreach ($products as $product) + $js .= 'MBG.add('.Tools::jsonEncode($product).');'; + + return $js.'MBG.addTransaction('.Tools::jsonEncode($order).');'; + } + + /** + * add product impression js and product click js + */ + public function addProductImpression($products) + { + if (!is_array($products)) + return; + + $js = ''; + foreach ($products as $product) + $js .= 'MBG.add('.Tools::jsonEncode($product).",'',true);"; + + return $js; + } + + public function addProductClick($products) + { + if (!is_array($products)) + return; + + $js = ''; + foreach ($products as $product) + $js .= 'MBG.addProductClick('.Tools::jsonEncode($product).');'; + + return $js; + } + + public function addProductClickByHttpReferal($products) + { + if (!is_array($products)) + return; + + $js = ''; + foreach ($products as $product) + $js .= 'MBG.addProductClickByHttpReferal('.Tools::jsonEncode($product).');'; + + return $js; + } + + /** + * Add product checkout info + */ + public function addProductFromCheckout($products) + { + if (!is_array($products)) + return; + + $js = ''; + foreach ($products as $product) + $js .= 'MBG.add('.Tools::jsonEncode($product).');'; + + return $js; + } + + /** + * hook product page footer to load JS for product details view + */ + public function hookProductFooter($params) + { + $controller_name = Tools::getValue('controller'); + if ($controller_name == 'product') + { + // Add product view + $ga_product = $this->wrapProduct((array)$params['product'], null, 0, true); + $js = 'MBG.addProductDetailView('.Tools::jsonEncode($ga_product).');'; + + if (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST']) > 0) + $js .= $this->addProductClickByHttpReferal(array($ga_product)); + + $this->js_state = 1; + return $this->_runJs($js); + } + } + + /** + * Generate Google Analytics js + */ + protected function _runJs($js_code, $backoffice = 0) + { + if (Configuration::get('GA_ACCOUNT_ID')) + { + $runjs_code = ''; + if (!empty($js_code)) + $runjs_code .= ' + '; + + if (($this->js_state) != 1 && ($backoffice == 0)) + $runjs_code .= ' + '; + + return $runjs_code; + } + } + + /** + * Hook admin order to send transactions and refunds details + */ + public function hookAdminOrder() + { + echo $this->_runJs($this->context->cookie->ga_admin_refund, 1); + unset($this->context->cookie->ga_admin_refund); + } + + /** + * admin office header to add google analytics js + */ + public function hookBackOfficeHeader() + { + $js = ''; + if (strcmp(Tools::getValue('configure'), $this->name) === 0) + { + if (version_compare(_PS_VERSION_, '1.5', '>') == true) + { + $this->context->controller->addCSS($this->_path.'views/css/ganalytics.css'); + if (version_compare(_PS_VERSION_, '1.6', '<') == true) + $this->context->controller->addCSS($this->_path.'views/css/ganalytics-nobootstrap.css'); + } + else + { + $js .= '\ + '; + } + } + + $ga_account_id = Configuration::get('GA_ACCOUNT_ID'); + + if (!empty($ga_account_id) && $this->active) + { + if (version_compare(_PS_VERSION_, '1.5', '>=') == true) + $this->context->controller->addJs($this->_path.'views/js/GoogleAnalyticActionLib.js'); + else + $js .= ''; + + $this->context->smarty->assign('GA_ACCOUNT_ID', $ga_account_id); + + $ga_scripts = ''; + if ($this->context->controller->controller_name == 'AdminOrders') + { + if (Tools::getValue('id_order')) + { + $order = new Order((int)Tools::getValue('id_order')); + if (Validate::isLoadedObject($order) && strtotime('+1 day', strtotime($order->date_add)) > time()) { + $ga_order_sent = Db::getInstance()->getValue('SELECT id_order FROM `'._DB_PREFIX_.'ganalytics` WHERE id_order = '.(int)Tools::getValue('id_order')); + if ($ga_order_sent === false) + Db::getInstance()->Execute('INSERT IGNORE INTO `'._DB_PREFIX_.'ganalytics` (id_order, id_shop, sent, date_add) VALUES ('.(int)Tools::getValue('id_order').', '.(int)$this->context->shop->id.', 0, NOW())'); + } + } + else + { + $ga_order_records = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'ganalytics` WHERE sent = 0 AND id_shop = \''.(int)$this->context->shop->id.'\' AND DATE_ADD(date_add, INTERVAL 30 minute) < NOW()'); + + if ($ga_order_records) + foreach ($ga_order_records as $row) + { + $transaction = $this->wrapOrder($row['id_order']); + if (!empty($transaction)) + { + Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'ganalytics` SET date_add = NOW(), sent = 1 WHERE id_order = '.(int)$row['id_order'].' AND id_shop = \''.(int)$this->context->shop->id.'\''); + $transaction = Tools::jsonEncode($transaction); + $ga_scripts .= 'MBG.addTransaction('.$transaction.');'; + } + } + + } + } + return $js.$this->_getGoogleAnalyticsTag(true).$this->_runJs($ga_scripts, 1); + } + else return $js; + } + + /** + * Hook admin office header to add google analytics js + */ + public function hookActionProductCancel($params) + { + $qty_refunded = Tools::getValue('cancelQuantity'); + $ga_scripts = ''; + foreach ($qty_refunded as $orderdetail_id => $qty) + { + // Display GA refund product + $order_detail = new OrderDetail($orderdetail_id); + $ga_scripts .= 'MBG.add('.Tools::jsonEncode( + array( + 'id' => empty($order_detail->product_attribute_id)?$order_detail->product_id:$order_detail->product_id.'-'.$order_detail->product_attribute_id, + 'quantity' => $qty) + ).');'; + } + $this->context->cookie->ga_admin_refund = $ga_scripts.'MBG.refundByProduct('.Tools::jsonEncode(array('id' => $params['order']->id)).');'; + } + + /** + * hook save cart event to implement addtocart and remove from cart functionality + */ + public function hookActionCartSave() + { + if (!isset($this->context->cart)) + return; + + if (!Tools::getIsset('id_product')) + return; + + $cart = array( + 'controller' => Tools::getValue('controller'), + 'addAction' => Tools::getValue('add') ? 'add' : '', + 'removeAction' => Tools::getValue('delete') ? 'delete' : '', + 'extraAction' => Tools::getValue('op'), + 'qty' => (int)Tools::getValue('qty', 1) + ); + + $cart_products = $this->context->cart->getProducts(); + if (isset($cart_products) && count($cart_products)) + foreach ($cart_products as $cart_product) + if ($cart_product['id_product'] == Tools::getValue('id_product')) + $add_product = $cart_product; + + if ($cart['removeAction'] == 'delete') + { + $add_product_object = new Product((int)Tools::getValue('id_product'), true, (int)Configuration::get('PS_LANG_DEFAULT')); + if (Validate::isLoadedObject($add_product_object)) + { + $add_product['name'] = $add_product_object->name; + $add_product['manufacturer_name'] = $add_product_object->manufacturer_name; + $add_product['category'] = $add_product_object->category; + $add_product['reference'] = $add_product_object->reference; + $add_product['link_rewrite'] = $add_product_object->link_rewrite; + $add_product['link'] = $add_product_object->link_rewrite; + $add_product['price'] = $add_product_object->price; + $add_product['ean13'] = $add_product_object->ean13; + $add_product['id_product'] = Tools::getValue('id_product'); + $add_product['id_category_default'] = $add_product_object->id_category_default; + $add_product['out_of_stock'] = $add_product_object->out_of_stock; + $add_product = Product::getProductProperties((int)Configuration::get('PS_LANG_DEFAULT'), $add_product); + } + } + + if (isset($add_product) && !in_array((int)Tools::getValue('id_product'), self::$products)) + { + self::$products[] = (int)Tools::getValue('id_product'); + $ga_products = $this->wrapProduct($add_product, $cart, 0, true); + + if (array_key_exists('id_product_attribute', $ga_products) && $ga_products['id_product_attribute'] != '' && $ga_products['id_product_attribute'] != 0) + $id_product = $ga_products['id_product_attribute']; + else + $id_product = Tools::getValue('id_product'); + + if (isset($this->context->cookie->ga_cart)) + $gacart = unserialize($this->context->cookie->ga_cart); + else + $gacart = array(); + + if ($cart['removeAction'] == 'delete') + $ga_products['quantity'] = -1; + elseif ($cart['extraAction'] == 'down') + { + if (array_key_exists($id_product, $gacart)) + $ga_products['quantity'] = $gacart[$id_product]['quantity'] - $cart['qty']; + else + $ga_products['quantity'] = $cart['qty'] * -1; + } + elseif (Tools::getValue('step') <= 0) // Sometimes cartsave is called in checkout + { + if (array_key_exists($id_product, $gacart)) + $ga_products['quantity'] = $gacart[$id_product]['quantity'] + $cart['qty']; + } + + $gacart[$id_product] = $ga_products; + $this->context->cookie->ga_cart = serialize($gacart); + } + } + + protected function checkForUpdates() + { + // Used by PrestaShop 1.3 & 1.4 + if (version_compare(_PS_VERSION_, '1.5', '<') && self::isInstalled($this->name)) + foreach (array('2.0.0', '2.0.4', '2.0.5', '2.0.6', '2.1.0') as $version) + { + $file = dirname(__FILE__).'/upgrade/Upgrade-'.$version.'.php'; + if (version_compare(Configuration::get('GANALYTICS'), $version, '<') && file_exists($file)) + { + include_once($file); + call_user_func('upgrade_module_'.str_replace('.', '_', $version), $this); + } + } + } + + protected function _debugLog($function, $log) + { + if (!$this->_debug) + return true; + + $myFile = _PS_MODULE_DIR_.$this->name.'/logs/analytics.log'; + $fh = fopen($myFile, 'a'); + fwrite($fh, date('F j, Y, g:i a').' '.$function."\n"); + fwrite($fh, print_r($log, true)."\n\n"); + fclose($fh); + } +} diff --git a/www/modules/ganalytics/index.php b/www/modules/ganalytics/index.php new file mode 100755 index 0000000..041b9eb --- /dev/null +++ b/www/modules/ganalytics/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/www/modules/ganalytics/it.php b/www/modules/ganalytics/it.php new file mode 100755 index 0000000..0241854 --- /dev/null +++ b/www/modules/ganalytics/it.php @@ -0,0 +1,49 @@ +ganalytics_7510f8b22dd3e10476096425f78d4239'] = 'Non hai ancora impostato l\'ID di Google Analytics'; +$_MODULE['<{ganalytics}prestashop>ganalytics_aba1a7971f85c725ba4aed21343eeb4b'] = 'Integra lo script di Google Analytics nel tuo negozio'; +$_MODULE['<{ganalytics}prestashop>ganalytics_fa214007826415a21a8456e3e09f999d'] = 'Sei sicuro di voler cancellare i tuoi dati?'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; +$_MODULE['<{ganalytics}prestashop>ganalytics_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d7c9ce3337a28d63ce6626d90fdaedaa'] = 'Il tuo nome utente'; +$_MODULE['<{ganalytics}prestashop>ganalytics_81eeab9506186e2dca8faefa78d54067'] = 'Esempio:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a3e7f361e6fc12caf872119338642143'] = 'Aggiorna ID'; +$_MODULE['<{ganalytics}prestashop>ganalytics_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Aiuto'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d78b0fcff6b55bafe615f3fc1572c282'] = 'La prima fase del monitoraggio delle transazioni e-commerce è quello di attivare i rapporti e-commerce per il profilo del tuo sito web.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d02388589ecfd3b58e0a90e42127ca61'] = 'Per attivare il rapporto dell\'e-commerce, segui queste fasi:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_11f4b4ba23dc72ee5e86ff5a90bdde60'] = 'Accedi al tuo account'; +$_MODULE['<{ganalytics}prestashop>ganalytics_b452493b16ead8b4b25ab3fb7174b8f5'] = 'Clicca su Modifica accanto al profilo che desideri attivare'; +$_MODULE['<{ganalytics}prestashop>ganalytics_95df6d8c97e880d8f6895d824d72c353'] = 'Nella pagina Impostazioni profilo, fai clic su modifica accanto alle informazioni profilo sito web principale'; +$_MODULE['<{ganalytics}prestashop>ganalytics_5189c0be0481408c9301c377818e69dc'] = 'Modifica il tasto radio del sito e-commerce da No a Sì.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_98d12a01ab2aeeb10b7100eecf1974a8'] = 'Per impostare gli obiettivi, inserisci i dati dell\'obiettivo:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a44698a775d2fec04549ba6a2ac00491'] = 'Ritorna alla pagina principale dell\'account '; +$_MODULE['<{ganalytics}prestashop>ganalytics_dbec126ee3be2cd285a32a8d413fd1fa'] = 'Individua il profilo per il quale desideri creare gli obiettivi, quindi clicca su Modifica'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c4af40d39b97cf98040540639841e27a'] = 'Selezionare uno dei 4 spazi adibiti agli obiettivi disponibili per il profilo, quindi clicca su Modifica'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c3b99aa9b4638183dc1bf55f955ed9ae'] = 'Inserire l\'URL dell\'obiettivo. Il raggiungimento di questa pagina segna una conversione riuscita'; +$_MODULE['<{ganalytics}prestashop>ganalytics_54849fd1a3b8bdde81bfd979bc43aaa9'] = 'Inserisci il nome dell\'obiettivo come dovrebbe apparire nel tuo account Google Analytics'; +$_MODULE['<{ganalytics}prestashop>ganalytics_62034d209119c06315f59a5de39c6717'] = 'Attiva l\'obiettivo'; +$_MODULE['<{ganalytics}prestashop>ganalytics_792795e7f3cedd66897ca35349101ba8'] = 'Quindi, definire un imbuto nel seguente modo:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_467ed594f2aa9b3e802037a10bad61b1'] = 'Inserisci l\'URL della prima pagina della canalizzazione di conversione. Questa pagina dovrebbe essere una pagina comune a tutti gli utenti che cercano di raggiungere il tuo obiettivo.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_2edf3f56ba30ad663429ba0e812a2396'] = 'Inserisci un nome per questa fase.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c909bea215f88ff0de9888dc95eed1ca'] = 'Se questa fase è un passaggio obbligatorio nella procedura di conversione, seleziona la casella a destra del passaggio.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9d25cb4b66791343ca319b3cdb82dba6'] = 'Continua a inserire i passaggi che conducono all\'obiettivo finché il percorso obiettivo è stato completamente definito. È possibile inserire fino a 10 passi, o anche solo un passo.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_1c681b64f4cd8f52aecbb55c98f5c768'] = 'Infine, configura le Impostazioni aggiuntive procedendo nel seguente modo:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_bb1ca9cfa0f3f7dbd06a2364c9a0dc9c'] = 'Se gli URL inseriti sopra sono case sensitive, segna la casella di controllo.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_047cf7562621a3639b3e04a63dc6b41f'] = 'Seleziona l\'obiettivo appropriato. ('; +$_MODULE['<{ganalytics}prestashop>ganalytics_d59048f21fd887ad520398ce677be586'] = 'Per saperne di più'; +$_MODULE['<{ganalytics}prestashop>ganalytics_f0c5b61aabf16d5ce925722b65c9aad8'] = 'sui tipi di corrispondenze e su come scegliere il tipo di corrispondenza per il tuo obiettivo.)'; +$_MODULE['<{ganalytics}prestashop>ganalytics_3dcb5dddc6b7c11d4ea76a60dc1a0466'] = 'Inserire un valore obiettivo. Questo è il valore utilizzato nei calcoli ROI di Google Analytics.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a39f026ca75c6279ac9487265c00e3f5'] = 'Fai clic su Salva modifiche per creare l\'obiettivo e la canalizzazione o su Annulla per uscire senza salvare.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_cd4952b65560a1242c68ffc980a6e515'] = 'Dimostrazione: Il processo di ordinazione'; +$_MODULE['<{ganalytics}prestashop>ganalytics_efbf206b1b60cc0400c6147723509bd6'] = 'Dopo aver attivato i rapporti e-commerce e selezionato il profilo inserire \'order-confirmation.php\' come pagina obiettivo'; +$_MODULE['<{ganalytics}prestashop>ganalytics_68db264effa9364901183d9d12fac500'] = 'Nome di questo obiettivo (per esempio \'elaborazione ordine\')'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9b8bc3519c65da8fac122f91ac5b7673'] = 'Attiva l\'obiettivo'; +$_MODULE['<{ganalytics}prestashop>ganalytics_86a358dd6df1ba0cb3565b88380ba7a6'] = 'Aggiungi \'Product.php\' come prima pagina della tua conversione '; +$_MODULE['<{ganalytics}prestashop>ganalytics_b7f896191caad09b5fc34e79f1cefa76'] = 'Dagli un nome (ad esempio, \'pagina del prodotto\')'; +$_MODULE['<{ganalytics}prestashop>ganalytics_ef7060dd05e779dcfbf82f236df43823'] = 'Non segnare la casella \'richiesta\' perché il cliente potrebbe essere visitato direttamente da un tasto \"aggiungi al carrello\', come nel blocco homefeatured sulla homepage'; +$_MODULE['<{ganalytics}prestashop>ganalytics_3bab28a0105361c49ca261ca08a19bf7'] = 'Proseguire inserendo i seguenti URL come fasi:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9bfb6e6af6e6793bfa9387e728187c87'] = '(Obbligatorio)'; +$_MODULE['<{ganalytics}prestashop>ganalytics_6a47891ae07f45802bc948d2618e36f5'] = 'Spuntare l\'opIone \'case sensitive\' '; +$_MODULE['<{ganalytics}prestashop>ganalytics_d2d0c38d112e1d775057388122ae7545'] = 'Salva questo nuovo obiettivo'; diff --git a/www/modules/ganalytics/logo.gif b/www/modules/ganalytics/logo.gif new file mode 100755 index 0000000..3dc44f2 Binary files /dev/null and b/www/modules/ganalytics/logo.gif differ diff --git a/www/modules/ganalytics/logo.png b/www/modules/ganalytics/logo.png new file mode 100755 index 0000000..a089b08 Binary files /dev/null and b/www/modules/ganalytics/logo.png differ diff --git a/www/modules/ganalytics/translations/en.php b/www/modules/ganalytics/translations/en.php new file mode 100755 index 0000000..1d19c52 --- /dev/null +++ b/www/modules/ganalytics/translations/en.php @@ -0,0 +1,54 @@ +ganalytics_7510f8b22dd3e10476096425f78d4239'] = 'You have not yet set your Google Analytics ID'; +$_MODULE['<{ganalytics}prestashop>ganalytics_aba1a7971f85c725ba4aed21343eeb4b'] = 'Integrate Google Analytics script into your shop'; +$_MODULE['<{ganalytics}prestashop>ganalytics_fa214007826415a21a8456e3e09f999d'] = 'Are you sure you want to delete your details ?'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c888438d14855d7d96a2724ee9c306bd'] = 'Settings updated'; +$_MODULE['<{ganalytics}prestashop>ganalytics_f4f70727dc34561dfde1a3c529b6205c'] = 'Settings'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d7c9ce3337a28d63ce6626d90fdaedaa'] = 'Your username'; +$_MODULE['<{ganalytics}prestashop>ganalytics_81eeab9506186e2dca8faefa78d54067'] = 'Example:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_b2e71617778d8acc54945b2e7cd5b16e'] = 'Universal Analytics Active'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a3e7f361e6fc12caf872119338642143'] = 'Update ID'; +$_MODULE['<{ganalytics}prestashop>ganalytics_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Help'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d78b0fcff6b55bafe615f3fc1572c282'] = 'The first step of tracking e-commerce transactions is to enable e-commerce reporting for your website\'s profile.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d02388589ecfd3b58e0a90e42127ca61'] = 'To enable e-Commerce reporting, please follow these steps:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_11f4b4ba23dc72ee5e86ff5a90bdde60'] = 'Log in to your account'; +$_MODULE['<{ganalytics}prestashop>ganalytics_b452493b16ead8b4b25ab3fb7174b8f5'] = 'Click Edit next to the profile you would like to enable.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_95df6d8c97e880d8f6895d824d72c353'] = 'On the Profile Settings page, click Edit (next to Main Website Profile Information).'; +$_MODULE['<{ganalytics}prestashop>ganalytics_5189c0be0481408c9301c377818e69dc'] = 'Change the e-Commerce Website radio button from No to Yes'; +$_MODULE['<{ganalytics}prestashop>ganalytics_98d12a01ab2aeeb10b7100eecf1974a8'] = 'To set up your goals, enter Goal Information:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a44698a775d2fec04549ba6a2ac00491'] = 'Return to Your Account main page'; +$_MODULE['<{ganalytics}prestashop>ganalytics_dbec126ee3be2cd285a32a8d413fd1fa'] = 'Find the profile for which you will be creating goals, then click Edit'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c4af40d39b97cf98040540639841e27a'] = 'Select one of the 4 goal slots available for that profile, then click Edit'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c3b99aa9b4638183dc1bf55f955ed9ae'] = 'Enter the Goal URL. Reaching this page marks a successful conversion.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_54849fd1a3b8bdde81bfd979bc43aaa9'] = 'Enter the Goal name as it should appear in your Google Analytics account.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_62034d209119c06315f59a5de39c6717'] = 'Turn on Goal.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_792795e7f3cedd66897ca35349101ba8'] = 'Then, define a funnel by following these steps:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_467ed594f2aa9b3e802037a10bad61b1'] = 'Enter the URL of the first page of your conversion funnel. This page should be a common page to all users working their way towards your Goal.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_2edf3f56ba30ad663429ba0e812a2396'] = 'Enter a Name for this step.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_c909bea215f88ff0de9888dc95eed1ca'] = 'If this step is a required step in the conversion process, mark the checkbox to the right of the step.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9d25cb4b66791343ca319b3cdb82dba6'] = 'Continue entering goal steps until your funnel has been completely defined. You may enter up to 10 steps, or only one step.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_1c681b64f4cd8f52aecbb55c98f5c768'] = 'Finally, configure Additional settings by following the steps below:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_bb1ca9cfa0f3f7dbd06a2364c9a0dc9c'] = 'If the URLs entered above are case sensitive, mark the checkbox.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_047cf7562621a3639b3e04a63dc6b41f'] = 'Select the appropriate goal Match Type. ('; +$_MODULE['<{ganalytics}prestashop>ganalytics_d59048f21fd887ad520398ce677be586'] = 'Learn more'; +$_MODULE['<{ganalytics}prestashop>ganalytics_f0c5b61aabf16d5ce925722b65c9aad8'] = 'about Match Types and how to choose the appropriate goal Match Type for your goal.)'; +$_MODULE['<{ganalytics}prestashop>ganalytics_3dcb5dddc6b7c11d4ea76a60dc1a0466'] = 'Enter a Goal value. This is the value used in Google Analytics\' ROI calculations.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_a39f026ca75c6279ac9487265c00e3f5'] = 'Click Save Changes to create this Goal and funnel, or Cancel to exit without saving.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_cd4952b65560a1242c68ffc980a6e515'] = 'Demonstration: The order process'; +$_MODULE['<{ganalytics}prestashop>ganalytics_efbf206b1b60cc0400c6147723509bd6'] = 'After having enabled your e-commerce reports and selected the respective profile enter \'order-confirmation.php\' as the targeted page URL.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_68db264effa9364901183d9d12fac500'] = 'Name this goal (for example \'Order process\')'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9b8bc3519c65da8fac122f91ac5b7673'] = 'Activate the goal'; +$_MODULE['<{ganalytics}prestashop>ganalytics_86a358dd6df1ba0cb3565b88380ba7a6'] = 'Add \'product.php\' as the first page of your conversion funnel'; +$_MODULE['<{ganalytics}prestashop>ganalytics_b7f896191caad09b5fc34e79f1cefa76'] = 'Give it a name (for example, \'Product page\')'; +$_MODULE['<{ganalytics}prestashop>ganalytics_ef7060dd05e779dcfbf82f236df43823'] = 'Do not mark the \'required\' checkbox because the customer could be visiting directly from an \'adding to cart\' button such as in the homefeatured block on the homepage.'; +$_MODULE['<{ganalytics}prestashop>ganalytics_3bab28a0105361c49ca261ca08a19bf7'] = 'Continue by entering the following URLs as goal steps:'; +$_MODULE['<{ganalytics}prestashop>ganalytics_9bfb6e6af6e6793bfa9387e728187c87'] = '(required)'; +$_MODULE['<{ganalytics}prestashop>ganalytics_6a47891ae07f45802bc948d2618e36f5'] = 'Check the \'Case sensitive\' option'; +$_MODULE['<{ganalytics}prestashop>ganalytics_d2d0c38d112e1d775057388122ae7545'] = 'Save this new goal'; + + +return $_MODULE; diff --git a/www/modules/ganalytics/translations/fr.php b/www/modules/ganalytics/translations/fr.php old mode 100644 new mode 100755 diff --git a/www/modules/ganalytics/translations/index.php b/www/modules/ganalytics/translations/index.php new file mode 100755 index 0000000..041b9eb --- /dev/null +++ b/www/modules/ganalytics/translations/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/www/modules/ganalytics/upgrade/Upgrade-2.0.0.php b/www/modules/ganalytics/upgrade/Upgrade-2.0.0.php new file mode 100755 index 0000000..6737451 --- /dev/null +++ b/www/modules/ganalytics/upgrade/Upgrade-2.0.0.php @@ -0,0 +1,44 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_PS_VERSION_')) + exit; + +function upgrade_module_2_0_0($object) +{ + Configuration::updateValue('GANALYTICS', '2.0.0'); + + return Db::getInstance()->execute(' + CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'ganalytics` ( + `id_google_analytics` int(11) NOT NULL AUTO_INCREMENT, + `id_order` int(11) NOT NULL, + `sent` tinyint(1) DEFAULT NULL, + `date_add` datetime DEFAULT NULL, + PRIMARY KEY (`id_google_analytics`), + KEY `id_order` (`id_order`), + KEY `sent` (`sent`) + ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8 AUTO_INCREMENT=1'); +} diff --git a/www/modules/ganalytics/upgrade/Upgrade-2.0.4.php b/www/modules/ganalytics/upgrade/Upgrade-2.0.4.php new file mode 100755 index 0000000..8b9ac52 --- /dev/null +++ b/www/modules/ganalytics/upgrade/Upgrade-2.0.4.php @@ -0,0 +1,49 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_PS_VERSION_')) + exit; + +function upgrade_module_2_0_4($object) +{ + Configuration::updateValue('GANALYTICS', '2.0.4'); + + return (Db::getInstance()->execute(' + CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'ganalytics` ( + `id_google_analytics` int(11) NOT NULL AUTO_INCREMENT, + `id_order` int(11) NOT NULL, + `sent` tinyint(1) DEFAULT NULL, + `date_add` datetime DEFAULT NULL, + PRIMARY KEY (`id_google_analytics`), + KEY `id_order` (`id_order`), + KEY `sent` (`sent`) + ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8 AUTO_INCREMENT=1') + && $object->registerHook('adminOrder') + && $object->registerHook('footer') + && $object->registerHook('home') + && $object->registerHook('backOfficeHeader') + && $object->registerHook('productfooter')); +} diff --git a/www/modules/ganalytics/upgrade/Upgrade-2.0.5.php b/www/modules/ganalytics/upgrade/Upgrade-2.0.5.php new file mode 100755 index 0000000..3c62654 --- /dev/null +++ b/www/modules/ganalytics/upgrade/Upgrade-2.0.5.php @@ -0,0 +1,34 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_PS_VERSION_')) + exit; +function upgrade_module_2_0_5($object) +{ + Configuration::updateValue('GANALYTICS', '2.0.5'); + return ($object->registerHook('orderConfirmation') + && $object->unregisterHook('top')); +} diff --git a/www/modules/ganalytics/upgrade/Upgrade-2.0.6.php b/www/modules/ganalytics/upgrade/Upgrade-2.0.6.php new file mode 100755 index 0000000..13943a3 --- /dev/null +++ b/www/modules/ganalytics/upgrade/Upgrade-2.0.6.php @@ -0,0 +1,38 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_PS_VERSION_')) + exit; +function upgrade_module_2_0_6($object) +{ + Configuration::updateValue('GANALYTICS', '2.0.6'); + + // This tab won't be used on PS 1.4 + if (version_compare(_PS_VERSION_, '1.5', '<')) + return true; + + return $object->installTab(); +} diff --git a/www/modules/ganalytics/upgrade/Upgrade-2.1.0.php b/www/modules/ganalytics/upgrade/Upgrade-2.1.0.php new file mode 100755 index 0000000..e719a92 --- /dev/null +++ b/www/modules/ganalytics/upgrade/Upgrade-2.1.0.php @@ -0,0 +1,37 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_PS_VERSION_')) + exit; +function upgrade_module_2_1_0($object) +{ + Configuration::updateValue('GANALYTICS', '2.1.0'); + return Db::getInstance()->execute(' + ALTER TABLE `'._DB_PREFIX_.'ganalytics` + ADD `id_customer` int(10) NOT NULL, + ADD `id_shop` int(11) NOT NULL' + ); +} diff --git a/www/modules/ganalytics/upgrade/Upgrade-2.2.1.php b/www/modules/ganalytics/upgrade/Upgrade-2.2.1.php new file mode 100755 index 0000000..081b4b3 --- /dev/null +++ b/www/modules/ganalytics/upgrade/Upgrade-2.2.1.php @@ -0,0 +1,32 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ +if (!defined('_PS_VERSION_')) + exit; +function upgrade_module_2_2_1($object) +{ + Configuration::updateValue('GA_USERID_ENABLED', false); + return true; +} diff --git a/www/modules/ganalytics/upgrade/index.php b/www/modules/ganalytics/upgrade/index.php new file mode 100755 index 0000000..041b9eb --- /dev/null +++ b/www/modules/ganalytics/upgrade/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/www/modules/ganalytics/views/css/ganalytics-nobootstrap.css b/www/modules/ganalytics/views/css/ganalytics-nobootstrap.css new file mode 100755 index 0000000..ab30063 --- /dev/null +++ b/www/modules/ganalytics/views/css/ganalytics-nobootstrap.css @@ -0,0 +1,74 @@ +/** +* 2007-2015 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +#content .panel { +border-radius: 5px; +border: 1px solid rgb(230, 230, 230); +font-family: 'Open Sans', Helvetica, Arial, sans-serif; +box-shadow: rgba(0, 0, 0, 0.0980392) 0px 2px 0px 0px, rgb(255, 255, 255) 0px 0px 0px 3px inset; +color: rgb(85, 85, 85); +display: block; +font-size: 12px; +background: white; +padding: 10px 20px 20px 20px; +margin-bottom: 10px; +} + +#content .panel .row { + display: flex; +} + +#content img { + max-width:100%; +} + +#content .panel .col-lg-6, +#content .panel .col-xs-6 { + display:inline-block; +} + +#advantages_list > div, +#google_analytics_top > div { + min-width:50%; + float: left; +} + + +#content hr { +border-bottom: 1px solid rgb(230, 230, 230); +} + +#google_analytics_top.row, +#google_analytics_content div { + background-color: white; +} + +#google_analytics_content a { +color: #00aff0; +} + +#google_analytics_top .text-right { +text-align: right; +} diff --git a/www/modules/ganalytics/views/css/ganalytics.css b/www/modules/ganalytics/views/css/ganalytics.css new file mode 100755 index 0000000..569db0d --- /dev/null +++ b/www/modules/ganalytics/views/css/ganalytics.css @@ -0,0 +1,17 @@ +#content .panel { + margin: 0 auto; + max-width: 1300px; +} + +#content .panel p { + margin-bottom:2em; +} + +#advantages_list .col-xs-6 { + height:5em; +} + +#advantages_list div > img { + margin: 1em; + width: 60px; +} diff --git a/www/modules/ganalytics/views/css/index.php b/www/modules/ganalytics/views/css/index.php new file mode 100755 index 0000000..041b9eb --- /dev/null +++ b/www/modules/ganalytics/views/css/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/www/modules/ganalytics/views/img/add_to_cart_icon.png b/www/modules/ganalytics/views/img/add_to_cart_icon.png new file mode 100755 index 0000000..bb6e0e5 Binary files /dev/null and b/www/modules/ganalytics/views/img/add_to_cart_icon.png differ diff --git a/www/modules/ganalytics/views/img/campaign_clicks_icon.png b/www/modules/ganalytics/views/img/campaign_clicks_icon.png new file mode 100755 index 0000000..ebd7745 Binary files /dev/null and b/www/modules/ganalytics/views/img/campaign_clicks_icon.png differ diff --git a/www/modules/ganalytics/views/img/checkout_icon.png b/www/modules/ganalytics/views/img/checkout_icon.png new file mode 100755 index 0000000..a5f2468 Binary files /dev/null and b/www/modules/ganalytics/views/img/checkout_icon.png differ diff --git a/www/modules/ganalytics/views/img/create_account_btn.png b/www/modules/ganalytics/views/img/create_account_btn.png new file mode 100755 index 0000000..a207657 Binary files /dev/null and b/www/modules/ganalytics/views/img/create_account_btn.png differ diff --git a/www/modules/ganalytics/views/img/ga_logo.png b/www/modules/ganalytics/views/img/ga_logo.png new file mode 100755 index 0000000..8f1e29a Binary files /dev/null and b/www/modules/ganalytics/views/img/ga_logo.png differ diff --git a/www/modules/ganalytics/views/img/index.php b/www/modules/ganalytics/views/img/index.php new file mode 100755 index 0000000..041b9eb --- /dev/null +++ b/www/modules/ganalytics/views/img/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/www/modules/ganalytics/views/img/merchandising_tools_icon.png b/www/modules/ganalytics/views/img/merchandising_tools_icon.png new file mode 100755 index 0000000..9433d34 Binary files /dev/null and b/www/modules/ganalytics/views/img/merchandising_tools_icon.png differ diff --git a/www/modules/ganalytics/views/img/product_detail_icon.png b/www/modules/ganalytics/views/img/product_detail_icon.png new file mode 100755 index 0000000..779c458 Binary files /dev/null and b/www/modules/ganalytics/views/img/product_detail_icon.png differ diff --git a/www/modules/ganalytics/views/img/purchase_icon.png b/www/modules/ganalytics/views/img/purchase_icon.png new file mode 100755 index 0000000..6dfdbf9 Binary files /dev/null and b/www/modules/ganalytics/views/img/purchase_icon.png differ diff --git a/www/modules/ganalytics/views/img/stats.png b/www/modules/ganalytics/views/img/stats.png new file mode 100755 index 0000000..f8ea5df Binary files /dev/null and b/www/modules/ganalytics/views/img/stats.png differ diff --git a/www/modules/ganalytics/views/index.php b/www/modules/ganalytics/views/index.php new file mode 100755 index 0000000..041b9eb --- /dev/null +++ b/www/modules/ganalytics/views/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/www/modules/ganalytics/views/js/GoogleAnalyticActionLib.js b/www/modules/ganalytics/views/js/GoogleAnalyticActionLib.js new file mode 100755 index 0000000..72062aa --- /dev/null +++ b/www/modules/ganalytics/views/js/GoogleAnalyticActionLib.js @@ -0,0 +1,178 @@ +/** + * 2007-2015 PrestaShop + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@prestashop.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade PrestaShop to newer + * versions in the future. If you wish to customize PrestaShop for your + * needs please refer to http://www.prestashop.com for more information. + * + * @author PrestaShop SA + * @copyright 2007-2015 PrestaShop SA + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + * International Registered Trademark & Property of PrestaShop SA + **/ + +/* globals $, ga, jQuery */ + +var GoogleAnalyticEnhancedECommerce = { + + setCurrency: function(Currency) { + ga('set', '&cu', Currency); + }, + + add: function(Product, Order, Impression) { + var Products = {}; + var Orders = {}; + + var ProductFieldObject = ['id', 'name', 'category', 'brand', 'variant', 'price', 'quantity', 'coupon', 'list', 'position', 'dimension1']; + var OrderFieldObject = ['id', 'affiliation', 'revenue', 'tax', 'shipping', 'coupon', 'list', 'step', 'option']; + + if (Product != null) { + if (Impression && Product.quantity !== undefined) { + delete Product.quantity; + } + + for (var productKey in Product) { + for (var i = 0; i < ProductFieldObject.length; i++) { + if (productKey.toLowerCase() == ProductFieldObject[i]) { + if (Product[productKey] != null) { + Products[productKey.toLowerCase()] = Product[productKey]; + } + + } + } + + } + } + + if (Order != null) { + for (var orderKey in Order) { + for (var j = 0; j < OrderFieldObject.length; j++) { + if (orderKey.toLowerCase() == OrderFieldObject[j]) { + Orders[orderKey.toLowerCase()] = Order[orderKey]; + } + } + } + } + + if (Impression) { + ga('ec:addImpression', Products); + } else { + ga('ec:addProduct', Products); + } + }, + + addProductDetailView: function(Product) { + this.add(Product); + ga('ec:setAction', 'detail'); + ga('send', 'event', 'UX', 'detail', 'Product Detail View',{'nonInteraction': 1}); + }, + + addToCart: function(Product) { + this.add(Product); + ga('ec:setAction', 'add'); + ga('send', 'event', 'UX', 'click', 'Add to Cart'); // Send data using an event. + }, + + removeFromCart: function(Product) { + this.add(Product); + ga('ec:setAction', 'remove'); + ga('send', 'event', 'UX', 'click', 'Remove From cart'); // Send data using an event. + }, + + addProductImpression: function(Product) { + //ga('send', 'pageview'); + }, + + /** + id, type, affiliation, revenue, tax, shipping and coupon. + **/ + refundByOrderId: function(Order) { + /** + * Refund an entire transaction. + **/ + ga('ec:setAction', 'refund', { + 'id': Order.id // Transaction ID is only required field for full refund. + }); + ga('send', 'event', 'Ecommerce', 'Refund', {'nonInteraction': 1}); + }, + + refundByProduct: function(Order) { + /** + * Refund a single product. + **/ + //this.add(Product); + + ga('ec:setAction', 'refund', { + 'id': Order.id, // Transaction ID is required for partial refund. + }); + ga('send', 'event', 'Ecommerce', 'Refund', {'nonInteraction': 1}); + }, + + addProductClick: function(Product) { + var ClickPoint = jQuery('a[href$="' + Product.url + '"].quick-view'); + + ClickPoint.on("click", function() { + GoogleAnalyticEnhancedECommerce.add(Product); + ga('ec:setAction', 'click', { + list: Product.list + }); + + ga('send', 'event', 'Product Quick View', 'click', Product.list, { + 'hitCallback': function() { + return !ga.loaded; + } + }); + }); + + }, + + addProductClickByHttpReferal: function(Product) { + this.add(Product); + ga('ec:setAction', 'click', { + list: Product.list + }); + + ga('send', 'event', 'Product Click', 'click', Product.list, { + 'nonInteraction': 1, + 'hitCallback': function() { + return !ga.loaded; + } + }); + + }, + + addTransaction: function(Order) { + + //this.add(Product); + ga('ec:setAction', 'purchase', Order); + ga('send', 'event','Transaction','purchase', { + 'hitCallback': function() { + $.get(Order.url, { + orderid: Order.id, + customer: Order.customer + }); + } + }); + + }, + + addCheckout: function(Step) { + ga('ec:setAction', 'checkout', { + 'step': Step + //'option':'Visa' + }); + //ga('send', 'pageview'); + } +}; diff --git a/www/modules/ganalytics/views/js/index.php b/www/modules/ganalytics/views/js/index.php new file mode 100755 index 0000000..041b9eb --- /dev/null +++ b/www/modules/ganalytics/views/js/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/www/modules/ganalytics/views/templates/admin/configuration.tpl b/www/modules/ganalytics/views/templates/admin/configuration.tpl new file mode 100755 index 0000000..41e8f08 --- /dev/null +++ b/www/modules/ganalytics/views/templates/admin/configuration.tpl @@ -0,0 +1,66 @@ +{* + * 2007-2015 PrestaShop + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@prestashop.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade PrestaShop to newer + * versions in the future. If you wish to customize PrestaShop for your + * needs please refer to http://www.prestashop.com for more information. + * + * @author PrestaShop SA + * @copyright 2007-2015 PrestaShop SA + * @version Release: $Revision: 7040 $ + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + * International Registered Trademark & Property of PrestaShop SA + *} + +
    +
    +
    + Google Analytics +
    +
    + +
    +
    +
    +
    +
    +
    +

    + {l s='Your customers go everywhere; shouldn\'t your analytics.' mod='ganalytics'} +

    + {l s='Google Analytics shows you the full customer picture across ads and videos, websites and social tools, tables and smartphones. That makes it easier to serve your current customers and win new ones.' mod='ganalytics'} +

    +

    {l s='With ecommerce functionality in Google Analytics you can gain clear insight into important metrics about shopper behavior and conversion, including:' mod='ganalytics'}

    +
    +
    {l s='Product detail views' mod='ganalytics'}
    +
    {l s='Internal merchandising Success' mod='ganalytics'}
    +
    {l s='"Add to cart" actions' mod='ganalytics'}
    +
    {l s='The checkout process' mod='ganalytics'}
    +
    {l s='Internal campaign clicks' mod='ganalytics'}
    +
    {l s='And purchase' mod='ganalytics'}
    +
    +
    +
    +

    +
    + {l s='Merchants are able to understand how far along users get in the buying process and where they are dropping off.' mod='ganalytics'} +

    +

    + {l s='Create your account to get started.' mod='ganalytics'} +

    +
    +
    +
    +
    diff --git a/www/modules/ganalytics/views/templates/admin/form-ps14.tpl b/www/modules/ganalytics/views/templates/admin/form-ps14.tpl new file mode 100755 index 0000000..f52984c --- /dev/null +++ b/www/modules/ganalytics/views/templates/admin/form-ps14.tpl @@ -0,0 +1,46 @@ +{* +* 2007-2015 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to license@prestashop.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade PrestaShop to newer +* versions in the future. If you wish to customize PrestaShop for your +* needs please refer to http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2015 PrestaShop SA +* @version Release: $Revision: 7040 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} +
    +
    + + Paramètres + + + + +
    +  * + +
    +
    + +
    + +
    + +
    * Champ requis
    +
    +
    diff --git a/www/modules/ganalytics/views/templates/admin/index.php b/www/modules/ganalytics/views/templates/admin/index.php new file mode 100755 index 0000000..041b9eb --- /dev/null +++ b/www/modules/ganalytics/views/templates/admin/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/www/modules/ganalytics/views/templates/index.php b/www/modules/ganalytics/views/templates/index.php new file mode 100755 index 0000000..041b9eb --- /dev/null +++ b/www/modules/ganalytics/views/templates/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2015 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header('Expires: Mon, 26 Jul 1998 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../'); +exit; diff --git a/www/modules/gsitemap/Readme.md b/www/modules/gsitemap/Readme.md new file mode 100644 index 0000000..1cbdbdc --- /dev/null +++ b/www/modules/gsitemap/Readme.md @@ -0,0 +1,37 @@ +# Google sitemap + +## About + +Generate your Google sitemap file + +## Contributing + +PrestaShop modules are open-source extensions to the PrestaShop e-commerce solution. Everyone is welcome and even encouraged to contribute with their own improvements. + +### Requirements + +Contributors **must** follow the following rules: + +* **Make your Pull Request on the "dev" branch**, NOT the "master" branch. +* Do not update the module's version number. +* Follow [the coding standards][1]. + +### Process in details + +Contributors wishing to edit a module's files should follow the following process: + +1. Create your GitHub account, if you do not have one already. +2. Fork the gsitemap project to your GitHub account. +3. Clone your fork to your local machine in the ```/modules``` directory of your PrestaShop installation. +4. Create a branch in your local clone of the module for your changes. +5. Change the files in your branch. Be sure to follow [the coding standards][1]! +6. Push your changed branch to your fork in your GitHub account. +7. Create a pull request for your changes **on the _'dev'_ branch** of the module's project. Be sure to follow [the commit message norm][2] in your pull request. If you need help to make a pull request, read the [Github help page about creating pull requests][3]. +8. Wait for one of the core developers either to include your change in the codebase, or to comment on possible improvements you should make to your code. + +That's it: you have contributed to this open-source project! Congratulations! + +[1]: http://doc.prestashop.com/display/PS16/Coding+Standards +[2]: http://doc.prestashop.com/display/PS16/How+to+write+a+commit+message +[3]: https://help.github.com/articles/using-pull-requests + diff --git a/www/modules/gsitemap/composer.json b/www/modules/gsitemap/composer.json new file mode 100644 index 0000000..75993d8 --- /dev/null +++ b/www/modules/gsitemap/composer.json @@ -0,0 +1,19 @@ +{ + "name": "prestashop/gsitemap", + "description": "PrestaShop module gsitemap", + "homepage": "https://github.com/PrestaShop/gsitemap", + "license": "AFL - Academic Free License (AFL 3.0)", + "authors": [ + { + "name": "PrestaShop SA", + "email": "contact@prestashop.com" + } + ], + "require": { + "php": ">=5.3.2" + }, + "config": { + "preferred-install": "dist" + }, + "type": "prestashop-module" +} diff --git a/www/modules/gsitemap/gsitemap-cron.php b/www/modules/gsitemap/gsitemap-cron.php new file mode 100644 index 0000000..95908d1 --- /dev/null +++ b/www/modules/gsitemap/gsitemap-cron.php @@ -0,0 +1,57 @@ + + * @copyright 2007-2016 PrestaShop SA + * @version Release: $Revision: 7515 $ + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + * International Registered Trademark & Property of PrestaShop SA + */ + +/* + * This file can be called using a cron to generate Google Sitemap files automatically + */ + +include(dirname(__FILE__).'/../../config/config.inc.php'); +include(dirname(__FILE__).'/../../init.php'); +/* Check to security tocken */ +if (substr(Tools::encrypt('gsitemap/cron'), 0, 10) != Tools::getValue('token') || !Module::isInstalled('gsitemap')) + die('Bad token'); + +$gsitemap = Module::getInstanceByName('gsitemap'); +/* Check if the module is enabled */ +if ($gsitemap->active) +{ + /* Check if the requested shop exists */ + $shops = Db::getInstance()->ExecuteS('SELECT id_shop FROM `'._DB_PREFIX_.'shop`'); + $list_id_shop = array(); + foreach ($shops as $shop) + $list_id_shop[] = (int)$shop['id_shop']; + + $id_shop = (isset($_GET['id_shop']) && in_array($_GET['id_shop'], $list_id_shop)) ? (int)$_GET['id_shop'] : (int)Configuration::get('PS_SHOP_DEFAULT'); + $gsitemap->cron = true; + + /* for the main run initiat the sitemap's files name stored in the database */ + if (!isset($_GET['continue'])) + $gsitemap->emptySitemap((int)$id_shop); + + /* Create the Google Sitemap's files */ + p($gsitemap->createSitemap((int)$id_shop)); + +} diff --git a/www/modules/gsitemap/gsitemap.php b/www/modules/gsitemap/gsitemap.php new file mode 100644 index 0000000..2b09e80 --- /dev/null +++ b/www/modules/gsitemap/gsitemap.php @@ -0,0 +1,907 @@ + + * @copyright 2007-2016 PrestaShop SA + * @version Release: $Revision: 7515 $ + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + * International Registered Trademark & Property of PrestaShop SA + */ + +if (!defined('_PS_VERSION_')) + exit; + +class Gsitemap extends Module +{ + const HOOK_ADD_URLS = 'gSitemapAppendUrls'; + + public $cron = false; + protected $sql_checks = array(); + + public function __construct() + { + $this->name = 'gsitemap'; + $this->tab = 'seo'; + $this->version = '3.2.1'; + $this->author = 'PrestaShop'; + $this->need_instance = 0; + + parent::__construct(); + + $this->displayName = $this->l('Google sitemap'); + $this->description = $this->l('Generate your Google sitemap file'); + + $this->type_array = array('home', 'meta', 'product', 'category', 'manufacturer', 'supplier', 'cms', 'module'); + + $metas = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'meta` ORDER BY `id_meta` ASC'); + $disabled_metas = explode(',', Configuration::get('GSITEMAP_DISABLE_LINKS')); + foreach ($metas as $meta) + if (in_array($meta['id_meta'], $disabled_metas)) + if (($key = array_search($meta['page'], $this->type_array)) !== false) + unset($this->type_array[$key]); + + } + + /** + * Google Sitemap installation process: + * + * Step 1 - Pre-set Configuration option values + * Step 2 - Install the Addon and create a database table to store Sitemap files name by shop + * + * @return boolean Installation result + */ + public function install() + { + foreach (array( + 'GSITEMAP_PRIORITY_HOME' => 1.0, + 'GSITEMAP_PRIORITY_PRODUCT' => 0.9, + 'GSITEMAP_PRIORITY_CATEGORY' => 0.8, + 'GSITEMAP_PRIORITY_MANUFACTURER' => 0.7, + 'GSITEMAP_PRIORITY_SUPPLIER' => 0.6, + 'GSITEMAP_PRIORITY_CMS' => 0.5, + 'GSITEMAP_FREQUENCY' => 'weekly', + 'GSITEMAP_CHECK_IMAGE_FILE' => false, + 'GSITEMAP_LAST_EXPORT' => false + ) as $key => $val) + if (!Configuration::updateValue($key, $val)) + return false; + + return parent::install() && + Db::getInstance()->Execute('CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'gsitemap_sitemap` (`link` varchar(255) DEFAULT NULL, `id_shop` int(11) DEFAULT 0) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;') && + $this->_installHook(); + } + + /** + * Registers hook(s) + * + * @return boolean + */ + protected function _installHook() + { + $hook = new Hook(); + $hook->name = self::HOOK_ADD_URLS; + $hook->title = 'GSitemap Append URLs'; + $hook->description = 'This hook allows a module to add URLs to a generated sitemap'; + $hook->position = true; + return $hook->save(); + } + + /** + * Google Sitemap uninstallation process: + * + * Step 1 - Remove Configuration option values from database + * Step 2 - Remove the database containing the generated Sitemap files names + * Step 3 - Uninstallation of the Addon itself + * + * @return boolean Uninstallation result + */ + public function uninstall() + { + foreach (array( + 'GSITEMAP_PRIORITY_HOME' => '', + 'GSITEMAP_PRIORITY_PRODUCT' => '', + 'GSITEMAP_PRIORITY_CATEGORY' => '', + 'GSITEMAP_PRIORITY_MANUFACTURER' => '', + 'GSITEMAP_PRIORITY_SUPPLIER' => '', + 'GSITEMAP_PRIORITY_CMS' => '', + 'GSITEMAP_FREQUENCY' => '', + 'GSITEMAP_CHECK_IMAGE_FILE' => '', + 'GSITEMAP_LAST_EXPORT' => '' + ) as $key => $val) + if (!Configuration::deleteByName($key)) + return false; + + $hook = new Hook(Hook::getIdByName(self::HOOK_ADD_URLS)); + if (Validate::isLoadedObject($hook)) + $hook->delete(); + + return parent::uninstall() && $this->removeSitemap(); + } + + /** + * Delete all the generated Sitemap files and drop the addon table. + * @return boolean + */ + public function removeSitemap() + { + $links = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'gsitemap_sitemap`'); + if ($links) + foreach ($links as $link) + if (!@unlink($this->normalizeDirectory(_PS_ROOT_DIR_).$link['link'])) + return false; + if (!Db::getInstance()->Execute('DROP TABLE `'._DB_PREFIX_.'gsitemap_sitemap`')) + return false; + + return true; + } + + public function getContent() + { + /* Store the posted parameters and generate a new Google Sitemap files for the current Shop */ + if (Tools::isSubmit('SubmitGsitemap')) + { + Configuration::updateValue('GSITEMAP_FREQUENCY', pSQL(Tools::getValue('gsitemap_frequency'))); + Configuration::updateValue('GSITEMAP_INDEX_CHECK', ''); + Configuration::updateValue('GSITEMAP_CHECK_IMAGE_FILE', pSQL(Tools::getValue('gsitemap_check_image_file'))); + $meta = ''; + if (Tools::getValue('gsitemap_meta')) + $meta .= implode(', ', Tools::getValue('gsitemap_meta')); + Configuration::updateValue('GSITEMAP_DISABLE_LINKS', $meta); + $this->emptySitemap(); + $this->createSitemap(); + } + /* if no posted form and the variable [continue] is found in the HTTP request variable keep creating sitemap */ + elseif (Tools::getValue('continue')) + $this->createSitemap(); + + /* Empty the Shop domain cache */ + if (method_exists('ShopUrl', 'resetMainDomainCache')) + ShopUrl::resetMainDomainCache(); + + $this->context->smarty->assign( + array( + 'gsitemap_form' => './index.php?tab=AdminModules&configure=gsitemap&token='.Tools::getAdminTokenLite('AdminModules').'&tab_module='.$this->tab.'&module_name=gsitemap', + 'gsitemap_cron' => _PS_BASE_URL_._MODULE_DIR_.'gsitemap/gsitemap-cron.php?token='.substr(Tools::encrypt('gsitemap/cron'), 0, 10).'&id_shop='.$this->context->shop->id, + 'gsitemap_feed_exists' => file_exists($this->normalizeDirectory(_PS_ROOT_DIR_).'index_sitemap.xml'), + 'gsitemap_last_export' => Configuration::get('GSITEMAP_LAST_EXPORT'), + 'gsitemap_frequency' => Configuration::get('GSITEMAP_FREQUENCY'), + 'gsitemap_store_url' => 'http://'.Tools::getShopDomain(false, true).__PS_BASE_URI__, + 'gsitemap_links' => Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'gsitemap_sitemap` WHERE id_shop = '.(int)$this->context->shop->id), + 'store_metas' => Meta::getMetasByIdLang((int)$this->context->cookie->id_lang), + 'gsitemap_disable_metas' => explode(',', Configuration::get('GSITEMAP_DISABLE_LINKS')), + 'gsitemap_customer_limit' => array( + 'max_exec_time' => (int)ini_get('max_execution_time'), + 'memory_limit' => intval(ini_get('memory_limit')) + ), + 'prestashop_ssl' => Configuration::get('PS_SSL_ENABLED'), + 'gsitemap_check_image_file' => Configuration::get('GSITEMAP_CHECK_IMAGE_FILE'), + 'shop' => $this->context->shop + ) + ); + + return $this->display(__FILE__, 'views/templates/admin/configuration.tpl'); + } + + /** + * Delete all the generated Sitemap files from the files system and the database. + * + * @param int $id_shop + * + * @return bool + */ + public function emptySitemap($id_shop = 0) + { + if (!isset($this->context)) + $this->context = new Context(); + if ($id_shop != 0) + $this->context->shop = new Shop((int)$id_shop); + $links = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'gsitemap_sitemap` WHERE id_shop = '.(int)$this->context->shop->id); + if ($links) + { + foreach ($links as $link) + @unlink($this->normalizeDirectory(_PS_ROOT_DIR_).$link['link']); + + return Db::getInstance()->Execute('DELETE FROM `'._DB_PREFIX_.'gsitemap_sitemap` WHERE id_shop = '.(int)$this->context->shop->id); + } + + return true; + } + + /** + * @param array $link_sitemap contain all the links for the Google Sitemap file to be generated + * @param array $new_link contain the link elements + * @param string $lang language of link to add + * @param int $index index of the current Google Sitemap file + * @param int $i count of elements added to sitemap main array + * @param int $id_obj identifier of the object of the link to be added to the Gogle Sitemap file + * + * @return bool + */ + public function _addLinkToSitemap(&$link_sitemap, $new_link, $lang, &$index, &$i, $id_obj) + { + if ($i <= 25000 && memory_get_usage() < 100000000) + { + $link_sitemap[] = $new_link; + $i++; + + return true; + } + else + { + $this->_recursiveSitemapCreator($link_sitemap, $lang, $index); + if ($index % 20 == 0 && !$this->cron) + { + $this->context->smarty->assign( + array( + 'gsitemap_number' => (int)$index, + 'gsitemap_refresh_page' => './index.php?tab=AdminModules&configure=gsitemap&token='.Tools::getAdminTokenLite('AdminModules').'&tab_module='.$this->tab.'&module_name=gsitemap&continue=1&type='.$new_link['type'].'&lang='.$lang.'&index='.$index.'&id='.intval($id_obj).'&id_shop='.$this->context->shop->id + ) + ); + + return false; + } + else if ($index % 20 == 0 && $this->cron) + { + header('Refresh: 5; url=http'.(Configuration::get('PS_SSL_ENABLED') ? 's' : '').'://'.Tools::getShopDomain(false, true).__PS_BASE_URI__.'modules/gsitemap/gsitemap-cron.php?continue=1&token='.substr(Tools::encrypt('gsitemap/cron'), 0, 10).'&type='.$new_link['type'].'&lang='.$lang.'&index='.$index.'&id='.intval($id_obj).'&id_shop='.$this->context->shop->id); + die(); + } + else + { + if ($this->cron) + header('location: http'.(Configuration::get('PS_SSL_ENABLED') ? 's' : '').'://'.Tools::getShopDomain(false, true).__PS_BASE_URI__.'modules/gsitemap/gsitemap-cron.php?continue=1&token='.substr(Tools::encrypt('gsitemap/cron'), 0, 10).'&type='.$new_link['type'].'&lang='.$lang.'&index='.$index.'&id='.intval($id_obj).'&id_shop='.$this->context->shop->id); + else + { + $admin_folder = str_replace(_PS_ROOT_DIR_, '', _PS_ADMIN_DIR_); + $admin_folder = substr($admin_folder, 1); + header('location: http'.(Configuration::get('PS_SSL_ENABLED') ? 's' : '').'://'.Tools::getShopDomain(false, true).__PS_BASE_URI__.$admin_folder.'/index.php?tab=AdminModules&configure=gsitemap&token='.Tools::getAdminTokenLite('AdminModules').'&tab_module='.$this->tab.'&module_name=gsitemap&continue=1&type='.$new_link['type'].'&lang='.$lang.'&index='.$index.'&id='.intval($id_obj).'&id_shop='.$this->context->shop->id); + } + die(); + } + } + } + + /** + * Hydrate $link_sitemap with home link + * + * @param array $link_sitemap contain all the links for the Google Sitemap file to be generated + * @param string $lang language of link to add + * @param int $index index of the current Google Sitemap file + * @param int $i count of elements added to sitemap main array + * + * @return bool + */ + protected function _getHomeLink(&$link_sitemap, $lang, &$index, &$i) + { + if (Configuration::get('PS_SSL_ENABLED') && Configuration::get('PS_SSL_ENABLED_EVERYWHERE')) + $protocol = 'https://'; + else + $protocol = 'http://'; + + return $this->_addLinkToSitemap( + $link_sitemap, array( + 'type' => 'home', + 'page' => 'home', + 'link' => $protocol.Tools::getShopDomainSsl(false).$this->context->shop->getBaseURI().(method_exists('Language', 'isMultiLanguageActivated') ? Language::isMultiLanguageActivated() ? $lang['iso_code'].'/' : '' : ''), + 'image' => false + ), $lang['iso_code'], $index, $i, -1 + ); + } + + /** + * Hydrate $link_sitemap with meta link + * + * @param array $link_sitemap contain all the links for the Google Sitemap file to be generated + * @param string $lang language of link to add + * @param int $index index of the current Google Sitemap file + * @param int $i count of elements added to sitemap main array + * @param int $id_meta meta object identifier + * + * @return bool + */ + protected function _getMetaLink(&$link_sitemap, $lang, &$index, &$i, $id_meta = 0) + { + if (method_exists('ShopUrl', 'resetMainDomainCache')) + ShopUrl::resetMainDomainCache(); + $link = new Link(); + if (version_compare(_PS_VERSION_, '1.6', '>=')) + $metas = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'meta` WHERE `configurable` > 0 AND `id_meta` >= '.(int)$id_meta.' ORDER BY `id_meta` ASC'); + else + $metas = Db::getInstance()->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'meta` WHERE `id_meta` >= '.(int)$id_meta.' ORDER BY `id_meta` ASC'); + foreach ($metas as $meta) + { + $url = ''; + if (!in_array($meta['id_meta'], explode(',', Configuration::get('GSITEMAP_DISABLE_LINKS')))) + { + $url_rewrite = Db::getInstance()->getValue('SELECT url_rewrite, id_shop FROM `'._DB_PREFIX_.'meta_lang` WHERE `id_meta` = '.(int)$meta['id_meta'].' AND `id_shop` ='.(int)$this->context->shop->id.' AND `id_lang` = '.(int)$lang['id_lang']); + Dispatcher::getInstance()->addRoute($meta['page'], (isset($url_rewrite) ? $url_rewrite : $meta['page']), $meta['page'], $lang['id_lang']); + $uri_path = Dispatcher::getInstance()->createUrl($meta['page'], $lang['id_lang'], array(), (bool)Configuration::get('PS_REWRITING_SETTINGS')); + $url .= Tools::getShopDomainSsl(true).(($this->context->shop->virtual_uri) ? __PS_BASE_URI__.$this->context->shop->virtual_uri : __PS_BASE_URI__).(Language::isMultiLanguageActivated() ? $lang['iso_code'].'/' : '').ltrim($uri_path, '/'); + + if (!$this->_addLinkToSitemap( + $link_sitemap, array( + 'type' => 'meta', + 'page' => $meta['page'], + 'link' => $url, + 'image' => false + ), $lang['iso_code'], $index, $i, $meta['id_meta'] + )) + return false; + } + } + + return true; + } + + /** + * Hydrate $link_sitemap with products link + * + * @param array $link_sitemap contain all the links for the Google Sitemap file to be generated + * @param string $lang language of link to add + * @param int $index index of the current Google Sitemap file + * @param int $i count of elements added to sitemap main array + * @param int $id_product product object identifier + * + * @return bool + */ + protected function _getProductLink(&$link_sitemap, $lang, &$index, &$i, $id_product = 0) + { + $link = new Link(); + if (method_exists('ShopUrl', 'resetMainDomainCache')) + ShopUrl::resetMainDomainCache(); + + $products_id = Db::getInstance()->ExecuteS('SELECT `id_product` FROM `'._DB_PREFIX_.'product_shop` WHERE `id_product` >= '.intval($id_product).' AND `active` = 1 AND `visibility` != \'none\' AND `id_shop`='.$this->context->shop->id.' ORDER BY `id_product` ASC'); + + foreach ($products_id as $product_id) + { + $product = new Product((int)$product_id['id_product'], false, (int)$lang['id_lang']); + + $url = $link->getProductLink($product, $product->link_rewrite, htmlspecialchars(strip_tags($product->category)), $product->ean13, (int)$lang['id_lang'], (int)$this->context->shop->id, 0, true); + + $id_image = Product::getCover((int)$product_id['id_product']); + if (isset($id_image['id_image'])) + { + $image_link = $this->context->link->getImageLink($product->link_rewrite, $product->id.'-'.(int)$id_image['id_image'], 'large_default'); + $image_link = (!in_array(rtrim(Context::getContext()->shop->virtual_uri, '/'), explode('/', $image_link))) ? str_replace( + array( + 'https', + Context::getContext()->shop->domain.Context::getContext()->shop->physical_uri + ), array( + 'http', + Context::getContext()->shop->domain.Context::getContext()->shop->physical_uri.Context::getContext()->shop->virtual_uri + ), $image_link + ) : $image_link; + } + $file_headers = (Configuration::get('GSITEMAP_CHECK_IMAGE_FILE')) ? @get_headers($image_link) : true; + $image_product = array(); + if (isset($image_link) && ($file_headers[0] != 'HTTP/1.1 404 Not Found' || $file_headers === true)) + $image_product = array( + 'title_img' => htmlspecialchars(strip_tags($product->name)), + 'caption' => htmlspecialchars(strip_tags($product->description_short)), + 'link' => $image_link + ); + if (!$this->_addLinkToSitemap( + $link_sitemap, array( + 'type' => 'product', + 'page' => 'product', + 'lastmod' => $product->date_upd, + 'link' => $url, + 'image' => $image_product + ), $lang['iso_code'], $index, $i, $product_id['id_product'] + )) + return false; + + unset($image_link); + } + + return true; + } + + /** + * Hydrate $link_sitemap with categories link + * + * @param array $link_sitemap contain all the links for the Google Sitemap file to be generated + * @param string $lang language of link to add + * @param int $index index of the current Google Sitemap file + * @param int $i count of elements added to sitemap main array + * @param int $id_category category object identifier + * + * @return bool + */ + protected function _getCategoryLink(&$link_sitemap, $lang, &$index, &$i, $id_category = 0) + { + $link = new Link(); + if (method_exists('ShopUrl', 'resetMainDomainCache')) + ShopUrl::resetMainDomainCache(); + + $categories_id = Db::getInstance()->ExecuteS( + 'SELECT c.id_category FROM `'._DB_PREFIX_.'category` c + INNER JOIN `'._DB_PREFIX_.'category_shop` cs ON c.`id_category` = cs.`id_category` + WHERE c.`id_category` >= '.intval($id_category).' AND c.`active` = 1 AND c.`id_category` != 1 AND c.id_parent > 0 AND c.`id_category` > 0 AND cs.`id_shop` = '.(int)$this->context->shop->id.' ORDER BY c.`id_category` ASC' + ); + + foreach ($categories_id as $category_id) + { + $category = new Category((int)$category_id['id_category'], (int)$lang['id_lang']); + $url = $link->getCategoryLink($category, urlencode($category->link_rewrite), (int)$lang['id_lang']); + + if ($category->id_image) + { + $image_link = $this->context->link->getCatImageLink($category->link_rewrite, (int)$category->id_image, 'category_default'); + $image_link = (!in_array(rtrim(Context::getContext()->shop->virtual_uri, '/'), explode('/', $image_link))) ? str_replace( + array( + 'https', + Context::getContext()->shop->domain.Context::getContext()->shop->physical_uri + ), array( + 'http', + Context::getContext()->shop->domain.Context::getContext()->shop->physical_uri.Context::getContext()->shop->virtual_uri + ), $image_link + ) : $image_link; + } + $file_headers = (Configuration::get('GSITEMAP_CHECK_IMAGE_FILE')) ? @get_headers($image_link) : true; + $image_category = array(); + if (isset($image_link) && ($file_headers[0] != 'HTTP/1.1 404 Not Found' || $file_headers === true)) + $image_category = array( + 'title_img' => htmlspecialchars(strip_tags($category->name)), + 'link' => $image_link + ); + + if (!$this->_addLinkToSitemap( + $link_sitemap, array( + 'type' => 'category', + 'page' => 'category', + 'lastmod' => $category->date_upd, + 'link' => $url, + 'image' => $image_category + ), $lang['iso_code'], $index, $i, (int)$category_id['id_category'] + )) + return false; + + unset($image_link); + } + + return true; + } + + /** + * return the link elements for the manufacturer object + * + * @param array $link_sitemap contain all the links for the Google Sitemap file to be generated + * @param string $lang language of link to add + * @param int $index index of the current Google Sitemap file + * @param int $i count of elements added to sitemap main array + * @param int $id_manufacturer manufacturer object identifier + * + * @return bool + */ + protected function _getManufacturerLink(&$link_sitemap, $lang, &$index, &$i, $id_manufacturer = 0) + { + $link = new Link(); + if (method_exists('ShopUrl', 'resetMainDomainCache')) + ShopUrl::resetMainDomainCache(); + $manufacturers_id = Db::getInstance()->ExecuteS( + 'SELECT m.`id_manufacturer` FROM `'._DB_PREFIX_.'manufacturer` m + INNER JOIN `'._DB_PREFIX_.'manufacturer_lang` ml on m.`id_manufacturer` = ml.`id_manufacturer`'. + ($this->tableColumnExists(_DB_PREFIX_.'manufacturer_shop') ? ' INNER JOIN `'._DB_PREFIX_.'manufacturer_shop` ms ON m.`id_manufacturer` = ms.`id_manufacturer` ' : ''). + ' WHERE m.`active` = 1 AND m.`id_manufacturer` >= '.(int)$id_manufacturer. + ($this->tableColumnExists(_DB_PREFIX_.'manufacturer_shop') ? ' AND ms.`id_shop` = '.(int)$this->context->shop->id : ''). + ' AND ml.`id_lang` = '.(int)$lang['id_lang']. + ' ORDER BY m.`id_manufacturer` ASC' + ); + foreach ($manufacturers_id as $manufacturer_id) + { + $manufacturer = new Manufacturer((int)$manufacturer_id['id_manufacturer'], $lang['id_lang']); + $url = $link->getManufacturerLink($manufacturer, $manufacturer->link_rewrite, $lang['id_lang']); + + $image_link = 'http'.(Configuration::get('PS_SSL_ENABLED') && Configuration::get('PS_SSL_ENABLED_EVERYWHERE') ? 's' : '').'://'.Tools::getMediaServer(_THEME_MANU_DIR_)._THEME_MANU_DIR_.((!file_exists(_PS_MANU_IMG_DIR_.'/'.(int)$manufacturer->id.'-medium_default.jpg')) ? $lang['iso_code'].'-default' : (int)$manufacturer->id).'-medium_default.jpg'; + $image_link = (!in_array(rtrim(Context::getContext()->shop->virtual_uri, '/'), explode('/', $image_link))) ? str_replace( + array( + 'https', + Context::getContext()->shop->domain.Context::getContext()->shop->physical_uri + ), array( + 'http', + Context::getContext()->shop->domain.Context::getContext()->shop->physical_uri.Context::getContext()->shop->virtual_uri + ), $image_link + ) : $image_link; + + $file_headers = (Configuration::get('GSITEMAP_CHECK_IMAGE_FILE')) ? @get_headers($image_link) : true; + $manifacturer_image = array(); + if ($file_headers[0] != 'HTTP/1.1 404 Not Found' || $file_headers === true) + $manifacturer_image = array( + 'title_img' => htmlspecialchars(strip_tags($manufacturer->name)), + 'caption' => htmlspecialchars(strip_tags($manufacturer->short_description)), + 'link' => $image_link + ); + if (!$this->_addLinkToSitemap( + $link_sitemap, array( + 'type' => 'manufacturer', + 'page' => 'manufacturer', + 'lastmod' => $manufacturer->date_upd, + 'link' => $url, + 'image' => $manifacturer_image + ), $lang['iso_code'], $index, $i, $manufacturer_id['id_manufacturer'] + )) + return false; + } + + return true; + } + + /** + * @param array $link_sitemap contain all the links for the Google Sitemap file to be generated + * @param string $lang language of link to add + * @param int $index index of the current Google Sitemap file + * @param int $i count of elements added to sitemap main array + * @param int $id_supplier supplier object identifier + * + * @return bool + */ + protected function _getSupplierLink(&$link_sitemap, $lang, &$index, &$i, $id_supplier = 0) + { + $link = new Link(); + if (method_exists('ShopUrl', 'resetMainDomainCache')) + ShopUrl::resetMainDomainCache(); + $suppliers_id = Db::getInstance()->ExecuteS( + 'SELECT s.`id_supplier` FROM `'._DB_PREFIX_.'supplier` s + INNER JOIN `'._DB_PREFIX_.'supplier_lang` sl ON s.`id_supplier` = sl.`id_supplier` '. + ($this->tableColumnExists(_DB_PREFIX_.'supplier_shop') ? 'INNER JOIN `'._DB_PREFIX_.'supplier_shop` ss ON s.`id_supplier` = ss.`id_supplier`' : '').' + WHERE s.`active` = 1 AND s.`id_supplier` >= '.(int)$id_supplier. + ($this->tableColumnExists(_DB_PREFIX_.'supplier_shop') ? ' AND ss.`id_shop` = '.(int)$this->context->shop->id : '').' + AND sl.`id_lang` = '.(int)$lang['id_lang'].' + ORDER BY s.`id_supplier` ASC' + ); + foreach ($suppliers_id as $supplier_id) + { + $supplier = new Supplier((int)$supplier_id['id_supplier'], $lang['id_lang']); + $url = $link->getSupplierLink($supplier, $supplier->link_rewrite, $lang['id_lang']); + + $image_link = 'http://'.Tools::getMediaServer(_THEME_SUP_DIR_)._THEME_SUP_DIR_.((!file_exists(_THEME_SUP_DIR_.'/'.(int)$supplier->id.'-medium_default.jpg')) ? $lang['iso_code'].'-default' : (int)$supplier->id).'-medium_default.jpg'; + $image_link = (!in_array(rtrim(Context::getContext()->shop->virtual_uri, '/'), explode('/', $image_link))) ? str_replace( + array( + 'https', + Context::getContext()->shop->domain.Context::getContext()->shop->physical_uri + ), array( + 'http', + Context::getContext()->shop->domain.Context::getContext()->shop->physical_uri.Context::getContext()->shop->virtual_uri + ), $image_link + ) : $image_link; + + $file_headers = (Configuration::get('GSITEMAP_CHECK_IMAGE_FILE')) ? @get_headers($image_link) : true; + $supplier_image = array(); + if ($file_headers[0] != 'HTTP/1.1 404 Not Found' || $file_headers === true) + $supplier_image = array( + 'title_img' => htmlspecialchars(strip_tags($supplier->name)), + 'link' => 'http'.(Configuration::get('PS_SSL_ENABLED') ? 's' : '').'://'.Tools::getMediaServer(_THEME_SUP_DIR_)._THEME_SUP_DIR_.((!file_exists(_THEME_SUP_DIR_.'/'.(int)$supplier->id.'-medium_default.jpg')) ? $lang['iso_code'].'-default' : (int)$supplier->id).'-medium_default.jpg' + ); + if (!$this->_addLinkToSitemap( + $link_sitemap, array( + 'type' => 'supplier', + 'page' => 'supplier', + 'lastmod' => $supplier->date_upd, + 'link' => $url, + 'image' => $supplier_image + ), $lang['iso_code'], $index, $i, $supplier_id['id_supplier'] + )) + return false; + } + + return true; + } + + /** + * return the link elements for the CMS object + * + * @param array $link_sitemap contain all the links for the Google Sitemap file to be generated + * @param string $lang the language of link to add + * @param int $index the index of the current Google Sitemap file + * @param int $i the count of elements added to sitemap main array + * @param int $id_cms the CMS object identifier + * + * @return bool + */ + protected function _getCmsLink(&$link_sitemap, $lang, &$index, &$i, $id_cms = 0) + { + $link = new Link(); + if (method_exists('ShopUrl', 'resetMainDomainCache')) + ShopUrl::resetMainDomainCache(); + $cmss_id = Db::getInstance()->ExecuteS( + 'SELECT c.`id_cms` FROM `'._DB_PREFIX_.'cms` c INNER JOIN `'._DB_PREFIX_.'cms_lang` cl ON c.`id_cms` = cl.`id_cms` '. + ($this->tableColumnExists(_DB_PREFIX_.'supplier_shop') ? 'INNER JOIN `'._DB_PREFIX_.'cms_shop` cs ON c.`id_cms` = cs.`id_cms` ' : ''). + 'INNER JOIN `'._DB_PREFIX_.'cms_category` cc ON c.id_cms_category = cc.id_cms_category AND cc.active = 1 + WHERE c.`active` =1 AND c.`indexation` =1 AND c.`id_cms` >= '.(int)$id_cms. + ($this->tableColumnExists(_DB_PREFIX_.'supplier_shop') ? ' AND cs.id_shop = '.(int)$this->context->shop->id : ''). + ' AND cl.`id_lang` = '.(int)$lang['id_lang']. + ' ORDER BY c.`id_cms` ASC' + ); + + if (is_array($cmss_id)) + foreach ($cmss_id as $cms_id) + { + $cms = new CMS((int)$cms_id['id_cms'], $lang['id_lang']); + $cms->link_rewrite = urlencode((is_array($cms->link_rewrite) ? $cms->link_rewrite[(int)$lang['id_lang']] : $cms->link_rewrite)); + $url = $link->getCMSLink($cms, null, null, $lang['id_lang']); + + if (!$this->_addLinkToSitemap( + $link_sitemap, array( + 'type' => 'cms', + 'page' => 'cms', + 'link' => $url, + 'image' => false + ), $lang['iso_code'], $index, $i, $cms_id['id_cms'] + )) + return false; + } + + return true; + } + + /** + * Returns link elements generated by modules subscribes to hook gsitemap::HOOK_ADD_URLS + * + * The hook expects modules to return a vector of associative arrays each of them being acceptable by + * the gsitemap::_addLinkToSitemap() second attribute (minus the 'type' index). + * The 'type' index is automatically set to 'module' (not sure here, should we be safe or trust modules?). + * + * @param array $link_sitemap by ref. accumulator for all the links for the Google Sitemap file to be generated + * @param string $lang the language being processed + * @param int $index the index of the current Google Sitemap file + * @param int $i the count of elements added to sitemap main array + * @param int $num_link restart at link number #$num_link + * @return boolean + */ + protected function _getModuleLink(&$link_sitemap, $lang, &$index, &$i, $num_link = 0) + { + $modules_links = Hook::exec(self::HOOK_ADD_URLS, array('lang' => $lang), null, true); + if (empty($modules_links) || !is_array($modules_links)) + return true; + $links = array(); + foreach ($modules_links as $module_links) + $links = array_merge($links, $module_links); + foreach ($module_links as $n => $link) + { + if ($num_link > $n) + continue; + $link['type'] = 'module'; + if (!$this->_addLinkToSitemap($link_sitemap, $link, $lang['iso_code'], $index, $i, $n)) + return false; + } + return true; + } + + /** + * Create the Google Sitemap by Shop + * + * @param int $id_shop Shop identifier + * + * @return bool + */ + public function createSitemap($id_shop = 0) + { + if (@fopen($this->normalizeDirectory(_PS_ROOT_DIR_).'/test.txt', 'w') == false) + { + $this->context->smarty->assign('google_maps_error', $this->l('An error occured while trying to check your file permissions. Please adjust your permissions to allow PrestaShop to write a file in your root directory.')); + + return false; + } + else + @unlink($this->normalizeDirectory(_PS_ROOT_DIR_).'test.txt'); + + if ($id_shop != 0) + $this->context->shop = new Shop((int)$id_shop); + + $type = Tools::getValue('type') ? Tools::getValue('type') : ''; + $languages = Language::getLanguages(true, $id_shop); + $lang_stop = Tools::getValue('lang') ? true : false; + $id_obj = Tools::getValue('id') ? (int)Tools::getValue('id') : 0; + foreach ($languages as $lang) + { + $i = 0; + $index = (Tools::getValue('index') && Tools::getValue('lang') == $lang['iso_code']) ? (int)Tools::getValue('index') : 0; + if ($lang_stop && $lang['iso_code'] != Tools::getValue('lang')) + continue; + elseif ($lang_stop && $lang['iso_code'] == Tools::getValue('lang')) + $lang_stop = false; + + $link_sitemap = array(); + foreach ($this->type_array as $type_val) + { + if ($type == '' || $type == $type_val) + { + $function = '_get'.ucfirst($type_val).'Link'; + if (!$this->$function($link_sitemap, $lang, $index, $i, $id_obj)) + return false; + $type = ''; + $id_obj = 0; + } + } + $this->_recursiveSitemapCreator($link_sitemap, $lang['iso_code'], $index); + $page = ''; + $index = 0; + } + + $this->_createIndexSitemap(); + Configuration::updateValue('GSITEMAP_LAST_EXPORT', date('r')); + Tools::file_get_contents('http://www.google.com/webmasters/sitemaps/ping?sitemap='.urlencode('http'.(Configuration::get('PS_SSL_ENABLED') ? 's' : '').'://'.Tools::getShopDomain(false, true).$this->context->shop->physical_uri.$this->context->shop->virtual_uri.$this->context->shop->id.'_index_sitemap.xml')); + + if ($this->cron) + die(); + header('location: ./index.php?tab=AdminModules&configure=gsitemap&token='.Tools::getAdminTokenLite('AdminModules').'&tab_module='.$this->tab.'&module_name=gsitemap&validation'); + die(); + } + + /** + * Store the generated Sitemap file to the database + * + * @param string $sitemap the name of the generated Google Sitemap file + * + * @return bool + */ + protected function _saveSitemapLink($sitemap) + { + if ($sitemap) + return Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'gsitemap_sitemap` (`link`, id_shop) VALUES (\''.pSQL($sitemap).'\', '.(int)$this->context->shop->id.')'); + + return false; + } + + /** + * @param array $link_sitemap contain all the links for the Google Sitemap file to be generated + * @param string $lang the language of link to add + * @param int $index the index of the current Google Sitemap file + * + * @return bool + */ + protected function _recursiveSitemapCreator($link_sitemap, $lang, &$index) + { + if (!count($link_sitemap)) + return false; + + $sitemap_link = $this->context->shop->id.'_'.$lang.'_'.$index.'_sitemap.xml'; + $write_fd = fopen($this->normalizeDirectory(_PS_ROOT_DIR_).$sitemap_link, 'w'); + + fwrite($write_fd, ''."\r\n".''."\r\n"); + foreach ($link_sitemap as $key => $file) + { + fwrite($write_fd, ''."\r\n"); + $lastmod = (isset($file['lastmod']) && !empty($file['lastmod'])) ? date('c', strtotime($file['lastmod'])) : null; + $this->_addSitemapNode($write_fd, htmlspecialchars(strip_tags($file['link'])), $this->_getPriorityPage($file['page']), Configuration::get('GSITEMAP_FREQUENCY'), $lastmod); + if ($file['image']) + { + $this->_addSitemapNodeImage( + $write_fd, htmlspecialchars(strip_tags($file['image']['link'])), isset($file['image']['title_img']) ? htmlspecialchars( + str_replace( + array( + "\r\n", + "\r", + "\n" + ), '', strip_tags($file['image']['title_img']) + ) + ) : '', isset($file['image']['caption']) ? htmlspecialchars( + str_replace( + array( + "\r\n", + "\r", + "\n" + ), '', strip_tags($file['image']['caption']) + ) + ) : '' + ); + } + fwrite($write_fd, ''."\r\n"); + } + fwrite($write_fd, ''."\r\n"); + fclose($write_fd); + $this->_saveSitemapLink($sitemap_link); + $index++; + + return true; + } + + /** + * return the priority value set in the configuration parameters + * + * @param string $page + * + * @return float|string|bool + */ + protected function _getPriorityPage($page) + { + return Configuration::get('GSITEMAP_PRIORITY_'.Tools::strtoupper($page)) ? Configuration::get('GSITEMAP_PRIORITY_'.Tools::strtoupper($page)) : 0.1; + } + + /** + * Add a new line to the sitemap file + * + * @param resource $fd file system object resource + * @param string $loc string the URL of the object page + * @param string $priority + * @param string $change_freq + * @param int $last_mod the last modification date/time as a timestamp + */ + protected function _addSitemapNode($fd, $loc, $priority, $change_freq, $last_mod = null) + { + fwrite($fd, ''.(Configuration::get('PS_REWRITING_SETTINGS') ? '' : $loc).''."\r\n".''.number_format($priority, 1, '.', '').''."\r\n".($last_mod ? ''.date('c', strtotime($last_mod)).'' : '')."\r\n".''.$change_freq.''."\r\n"); + } + + protected function _addSitemapNodeImage($fd, $link, $title, $caption) + { + fwrite($fd, ''."\r\n".''.(Configuration::get('PS_REWRITING_SETTINGS') ? '' : $link).''."\r\n".''."\r\n".''."\r\n".''."\r\n"); + } + + /** + * Create the index file for all generated sitemaps + * @return boolean + */ + protected function _createIndexSitemap() + { + $sitemaps = Db::getInstance()->ExecuteS('SELECT `link` FROM `'._DB_PREFIX_.'gsitemap_sitemap` WHERE id_shop = '.$this->context->shop->id); + if (!$sitemaps) + return false; + + $xml = ''; + $xml_feed = new SimpleXMLElement($xml); + + foreach ($sitemaps as $link) + { + $sitemap = $xml_feed->addChild('sitemap'); + $sitemap->addChild('loc', 'http'.(Configuration::get('PS_SSL_ENABLED') && Configuration::get('PS_SSL_ENABLED_EVERYWHERE') ? 's' : '').'://'.Tools::getShopDomain(false, true).__PS_BASE_URI__.$link['link']); + $sitemap->addChild('lastmod', date('c')); + } + file_put_contents($this->normalizeDirectory(_PS_ROOT_DIR_).$this->context->shop->id.'_index_sitemap.xml', $xml_feed->asXML()); + + return true; + } + + protected function tableColumnExists($table_name, $column = null) + { + if (array_key_exists($table_name, $this->sql_checks)) + if (!empty($column) && array_key_exists($column, $this->sql_checks[$table_name])) + return $this->sql_checks[$table_name][$column]; + else + return $this->sql_checks[$table_name]; + + $table = Db::getInstance()->ExecuteS('SHOW TABLES LIKE \''.$table_name.'\''); + if (empty($column)) + if (count($table) < 1) + return $this->sql_checks[$table_name] = false; + else + $this->sql_checks[$table_name] = true; + + else + { + $table = Db::getInstance()->ExecuteS('SELECT * FROM `'.$table_name.'` LIMIT 1'); + + return $this->sql_checks[$table_name][$column] = array_key_exists($column, current($table)); + } + + return true; + } + + protected function normalizeDirectory($directory) + { + $last = $directory[strlen($directory) - 1]; + + if (in_array($last, array('/', '\\'))) + { + $directory[strlen($directory) - 1] = DIRECTORY_SEPARATOR; + return $directory; + } + + $directory .= DIRECTORY_SEPARATOR; + return $directory; + } +} diff --git a/www/modules/gsitemap/img/logo.jpg b/www/modules/gsitemap/img/logo.jpg new file mode 100644 index 0000000..b49f602 Binary files /dev/null and b/www/modules/gsitemap/img/logo.jpg differ diff --git a/www/modules/gsitemap/img/logo.png b/www/modules/gsitemap/img/logo.png new file mode 100644 index 0000000..dcab9f3 Binary files /dev/null and b/www/modules/gsitemap/img/logo.png differ diff --git a/www/modules/gsitemap/index.php b/www/modules/gsitemap/index.php new file mode 100644 index 0000000..dbfe1b5 --- /dev/null +++ b/www/modules/gsitemap/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2016 PrestaShop SA +* @version Release: $Revision: 13573 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); + +header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; \ No newline at end of file diff --git a/www/modules/gsitemap/logo.gif b/www/modules/gsitemap/logo.gif new file mode 100644 index 0000000..d24a14a Binary files /dev/null and b/www/modules/gsitemap/logo.gif differ diff --git a/www/modules/gsitemap/logo.png b/www/modules/gsitemap/logo.png new file mode 100644 index 0000000..3d217b1 Binary files /dev/null and b/www/modules/gsitemap/logo.png differ diff --git a/www/modules/gsitemap/translations/index.php b/www/modules/gsitemap/translations/index.php new file mode 100644 index 0000000..e5064df --- /dev/null +++ b/www/modules/gsitemap/translations/index.php @@ -0,0 +1,35 @@ + +* @copyright 2007-2016 PrestaShop SA +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); + +header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; \ No newline at end of file diff --git a/www/modules/gsitemap/upgrade/install-2.2.php b/www/modules/gsitemap/upgrade/install-2.2.php new file mode 100644 index 0000000..018997c --- /dev/null +++ b/www/modules/gsitemap/upgrade/install-2.2.php @@ -0,0 +1,49 @@ + +* @copyright 2007-2016 PrestaShop SA +* @version Release: $Revision: 14390 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +if (!defined('_PS_VERSION_')) + exit; + +function upgrade_module_2_2($object, $install = false) +{ + if ($object->active || $install) + { + Configuration::updateValue('GSITEMAP_PRIORITY_HOME', 1.0); + Configuration::updateValue('GSITEMAP_PRIORITY_PRODUCT', 0.9); + Configuration::updateValue('GSITEMAP_PRIORITY_CATEGORY', 0.8); + Configuration::updateValue('GSITEMAP_PRIORITY_MANUFACTURER', 0.7); + Configuration::updateValue('GSITEMAP_PRIORITY_SUPPLIER', 0.6); + Configuration::updateValue('GSITEMAP_PRIORITY_CMS', 0.5); + Configuration::updateValue('GSITEMAP_FREQUENCY', 'weekly'); + Configuration::updateValue('GSITEMAP_LAST_EXPORT', false); + + return Db::getInstance()->Execute('DROP TABLE IF EXISTS `'._DB_PREFIX_.'gsitemap_sitemap`') && Db::getInstance()->Execute('CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'gsitemap_sitemap` (`link` varchar(255) DEFAULT NULL, `id_shop` int(11) DEFAULT 0) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;'); + } + $object->upgrade_detail['2.2'][] = 'GSitemap upgrade error !'; + return false; +} \ No newline at end of file diff --git a/www/modules/gsitemap/views/index.php b/www/modules/gsitemap/views/index.php new file mode 100644 index 0000000..dbfe1b5 --- /dev/null +++ b/www/modules/gsitemap/views/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2016 PrestaShop SA +* @version Release: $Revision: 13573 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); + +header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; \ No newline at end of file diff --git a/www/modules/gsitemap/views/templates/admin/configuration.tpl b/www/modules/gsitemap/views/templates/admin/configuration.tpl new file mode 100644 index 0000000..3ba6d3c --- /dev/null +++ b/www/modules/gsitemap/views/templates/admin/configuration.tpl @@ -0,0 +1,119 @@ +
    +
    +{if isset($smarty.get.validation)} +
    + {l s='Your Sitemaps were successfully created. Please do not forget to setup the URL' mod='gsitemap'} {$gsitemap_store_url|escape:'htmlall':'UTF-8'}{$shop->id|intval}_index_sitemap.xml {l s='in your Google Webmaster account.' mod='gsitemap'} +
    +
    +{/if} +{if isset($google_maps_error)} +
    + {$google_maps_error|escape:'htmlall':'UTF-8'}
    +
    +{/if} +{if isset($gsitemap_refresh_page)} +
    + {l s='Your Sitemaps' mod='gsitemap'} +

    {$gsitemap_number|intval} {l s='Sitemaps were already created.' mod='gsitemap'}
    +

    +
    +
    + + +
    +
    +{else} + {if $gsitemap_links} +
    + {l s='Your Sitemaps' mod='gsitemap'} + {l s='Please set up the following Sitemap URL in your Google Webmaster account:' mod='gsitemap'}
    + {$gsitemap_store_url|escape:'htmlall':'UTF-8'}{$shop->id|intval}_index_sitemap.xml

    + {l s='This URL is the master Sitemaps file. It refers to the following sub-sitemap files:' mod='gsitemap'} +
    + +
    +

    {l s='Your last update was made on this date:' mod='gsitemap'} {$gsitemap_last_export|escape:'htmlall':'UTF-8'}

    +
    + {/if} +
    + {if ($gsitemap_customer_limit.max_exec_time < 30 && $gsitemap_customer_limit.max_exec_time > 0) || ($gsitemap_customer_limit.memory_limit < 128 && $gsitemap_customer_limit.memory_limit > 0)} +
    +

    {l s='For a better use of the module, please make sure that you have' mod='gsitemap'}
    +

      + {if $gsitemap_customer_limit.memory_limit < 128 && $gsitemap_customer_limit.memory_limit > 0} +
    • {l s='a minimum memory_limit value of 128 MB.' mod='gsitemap'}
    • + {/if} + {if $gsitemap_customer_limit.max_exec_time < 30 && $gsitemap_customer_limit.max_exec_time > 0} +
    • {l s='a minimum max_execution_time value of 30 seconds.' mod='gsitemap'}
    • + {/if} +
    + {l s='You can edit these limits in your php.ini file. For more details, please contact your hosting provider.' mod='gsitemap'}

    +
    +{/if} +
    +
    +
    + {l s='Configure your Sitemap' mod='gsitemap'} +

    {l s='Several Sitemaps files will be generated depending on how your server is configured and on the number of activated products in your catalog.' mod='gsitemap'}

    +
    + +
    + + +
    +

    {l s='Indicate the pages that you do not want to include in your Sitemaps file:' mod='gsitemap'}

    +
      + {foreach from=$store_metas item=store_meta} +
    • + {$store_meta.title|escape:'htmlall':'UTF-8'} [{$store_meta.page|escape:'htmlall':'UTF-8'}] +
    • + {/foreach} +
    +
    +
    + {l s='This can take several minutes' mod='gsitemap'} +
    + +
    +

    + +

    + {l s='You have two ways to generate Sitemap:' mod='gsitemap'}

    + 1. {l s='Manually:' mod='gsitemap'} {l s='using the form above (as often as needed)' mod='gsitemap'}
    +
    {l s='-or-' mod='gsitemap'}

    + 2. {l s='Automatically:' mod='gsitemap'} {l s='Ask your hosting provider to setup a "Cron task" to load the following URL at the time you would like:' mod='gsitemap'} + {$gsitemap_cron|escape:'htmlall':'UTF-8'}

    + {l s='It will automatically generate your XML Sitemaps.' mod='gsitemap'}

    +

    +{/if} + diff --git a/www/modules/gsitemap/views/templates/admin/index.php b/www/modules/gsitemap/views/templates/admin/index.php new file mode 100644 index 0000000..dbfe1b5 --- /dev/null +++ b/www/modules/gsitemap/views/templates/admin/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2016 PrestaShop SA +* @version Release: $Revision: 13573 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); + +header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; \ No newline at end of file diff --git a/www/modules/gsitemap/views/templates/index.php b/www/modules/gsitemap/views/templates/index.php new file mode 100644 index 0000000..dbfe1b5 --- /dev/null +++ b/www/modules/gsitemap/views/templates/index.php @@ -0,0 +1,36 @@ + +* @copyright 2007-2016 PrestaShop SA +* @version Release: $Revision: 13573 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); + +header("Cache-Control: no-store, no-cache, must-revalidate"); +header("Cache-Control: post-check=0, pre-check=0", false); +header("Pragma: no-cache"); + +header("Location: ../"); +exit; \ No newline at end of file diff --git a/www/modules/kwk_sync/inc/bootstrap.php b/www/modules/kwk_sync/inc/bootstrap.php index 25439bc..a5d5367 100644 --- a/www/modules/kwk_sync/inc/bootstrap.php +++ b/www/modules/kwk_sync/inc/bootstrap.php @@ -1,6 +1,6 @@ createUrl('product_rule', $id_lang, $params, $force_routes, $anchor, $id_shop); } + + public function getImageLink($name, $ids, $type = null) + { + $not_default = false; + + // Check if module is installed, enabled, customer is logged in and watermark logged option is on + if (($type != '') && Configuration::get('WATERMARK_LOGGED') && (Module::isInstalled('watermark') && Module::isEnabled('watermark')) && isset(Context::getContext()->customer->id)) { + $type .= '-'.Configuration::get('WATERMARK_HASH'); + } + + // legacy mode or default image + $theme = ((Shop::isFeatureActive() && file_exists(_PS_PROD_IMG_DIR_.$ids.($type ? '-'.$type : '').'-'.(int)Context::getContext()->shop->id_theme.'.jpg')) ? '-'.Context::getContext()->shop->id_theme : ''); + if ((Configuration::get('PS_LEGACY_IMAGES') + && (file_exists(_PS_PROD_IMG_DIR_.$ids.($type ? '-'.$type : '').$theme.'.jpg'))) + || ($not_default = strpos($ids, 'default') !== false)) { + if ($this->allow == 1 && !$not_default) { + $uri_path = __PS_BASE_URI__.$ids.($type ? '-'.$type : '').$theme.'/'.$name.'.jpg'; + } else { + $uri_path = _THEME_PROD_DIR_.$ids.($type ? '-'.$type : '').$theme.'.jpg'; + } + } else { + // if ids if of the form id_product-id_image, we want to extract the id_image part + $split_ids = explode('-', $ids); + $id_image = (isset($split_ids[1]) ? $split_ids[1] : $split_ids[0]); + $theme = ((Shop::isFeatureActive() && file_exists(_PS_PROD_IMG_DIR_.Image::getImgFolderStatic($id_image).$id_image.($type ? '-'.$type : '').'-'.(int)Context::getContext()->shop->id_theme.'.jpg')) ? '-'.Context::getContext()->shop->id_theme : ''); + if ($this->allow == 1) { + if(is_array($name)) { + $name = array_shift($name); + } + $uri_path = __PS_BASE_URI__.$id_image.($type ? '-'.$type : '').$theme.'/'.$name.'.jpg'; + } else { + $uri_path = _THEME_PROD_DIR_.Image::getImgFolderStatic($id_image).$id_image.($type ? '-'.$type : '').$theme.'.jpg'; + } + } + + return $this->protocol_content.Tools::getMediaServer($uri_path).$uri_path; + } + } \ No newline at end of file diff --git a/www/themes/versionecologique/breadcrumb.tpl b/www/themes/versionecologique/breadcrumb.tpl index 3b24b77..a47ae6a 100644 --- a/www/themes/versionecologique/breadcrumb.tpl +++ b/www/themes/versionecologique/breadcrumb.tpl @@ -4,7 +4,7 @@
    {if isset($smarty.capture.path)}{assign var='path' value=$smarty.capture.path}{/if} - {l s='Home'} + {l s='Home'} {if isset($path) AND $path} {if $path|strpos:'span' !== false} {$path|@replace:'>': ''} diff --git a/www/themes/versionecologique/category.tpl b/www/themes/versionecologique/category.tpl index d32b03b..6e0382c 100644 --- a/www/themes/versionecologique/category.tpl +++ b/www/themes/versionecologique/category.tpl @@ -62,7 +62,7 @@
    - +

    {$subcategory.name} diff --git a/www/themes/versionecologique/cms.tpl b/www/themes/versionecologique/cms.tpl index 73b8c95..ca0b7d6 100644 --- a/www/themes/versionecologique/cms.tpl +++ b/www/themes/versionecologique/cms.tpl @@ -1,5 +1,7 @@ +{if isset($cms)} {capture name=path}{$cms->meta_title}{/capture} {capture name=title}{$cms->meta_title}{/capture} +{/if}
    @@ -15,7 +17,7 @@ {if isset($cms)} {if !empty($cms->matrices)} {if !empty($cms->hasBanner)} -
    +

    {$cms->meta_title}

    @@ -63,10 +65,10 @@
    {if $matrice.hasImg}
    + {if $matrice.noPadding[$id_lang]} style="background: url({$base_dir_ssl}img/cms/matrices/{$matrice.image[$id_lang]}.jpg) no-repeat; background-size:cover;"> {else} > - + {if $matrice.textImage[$id_lang]}
    {$matrice.textImage[$id_lang]}
    {/if} @@ -89,10 +91,10 @@
    {if $matrice.hasImg}
    + {if $matrice.noPadding[$id_lang]} style="background: url({$base_dir_ssl}img/cms/matrices/{$matrice.image[$id_lang]}.jpg) no-repeat; background-size:cover;"> {else} > - + {if $matrice.textImage[$id_lang]}
    {$matrice.textImage[$id_lang]}
    {/if} @@ -114,7 +116,7 @@
    {if $matrice.hasImg}
    - + {if $matrice.textImage[$id_lang]}
    {$matrice.textImage[$id_lang]}
    {/if} @@ -139,7 +141,7 @@ {*Image pleine largeur avec bloc texte*} {if $imgFullWithText} -
    +

    {$matrice.titre[$id_lang]}

    @@ -154,7 +156,7 @@ {else} {*{include file="$tpl_dir./page-heading.tpl" title=$smarty.capture.title type=''}*} {if !empty($cms->hasBanner)} -
    +

    {$cms->meta_title}

    @@ -213,4 +215,4 @@ {if isset($smarty.get.adtoken) && $smarty.get.adtoken} {addJsDefL name=adtoken}{$smarty.get.adtoken|escape:'html':'UTF-8'}{/addJsDefL} {/if} -{/strip} \ No newline at end of file +{/strip} diff --git a/www/themes/versionecologique/header-meta-fb.tpl b/www/themes/versionecologique/header-meta-fb.tpl index e5583db..6820984 100644 --- a/www/themes/versionecologique/header-meta-fb.tpl +++ b/www/themes/versionecologique/header-meta-fb.tpl @@ -1 +1 @@ - {if $page_name == 'index'} {if isset($meta_description) AND $meta_description} {/if} {elseif $page_name == 'category' && isset($category)} {if !empty($category->description)} {/if} {elseif $page_name == 'product' && isset($product)} {if !empty($product->resume)} {elseif !empty($product->description)} {/if} {if isset($price)} {/if} {if isset($weight) && ($weight != 0)} {/if} {elseif $page_name == 'module-psblog-posts'} {if isset($post_images[0])} {/if} {else} {if isset($meta_description) AND $meta_description} {/if} {/if} \ No newline at end of file + {if $page_name == 'index'} {if isset($meta_description) AND $meta_description} {/if} {elseif $page_name == 'category' && isset($category)} {if !empty($category->description)} {/if} {elseif $page_name == 'product' && isset($product)} {if !empty($product->resume)} {elseif !empty($product->description)} {/if} {if isset($price)} {/if} {if isset($weight) && ($weight != 0)} {/if} {elseif $page_name == 'module-psblog-posts'} {if isset($post_images[0])} {/if} {else} {if isset($meta_description) AND $meta_description} {/if} {/if} \ No newline at end of file diff --git a/www/themes/versionecologique/modules/advconstructor/about.tpl b/www/themes/versionecologique/modules/advconstructor/about.tpl index cc0304b..5676be2 100644 --- a/www/themes/versionecologique/modules/advconstructor/about.tpl +++ b/www/themes/versionecologique/modules/advconstructor/about.tpl @@ -1,5 +1,5 @@
    - {**} + {**}

    {$block->title}

    diff --git a/www/themes/versionecologique/modules/advconstructor/blocbleuclair.tpl b/www/themes/versionecologique/modules/advconstructor/blocbleuclair.tpl index 0b16927..ef6ab18 100644 --- a/www/themes/versionecologique/modules/advconstructor/blocbleuclair.tpl +++ b/www/themes/versionecologique/modules/advconstructor/blocbleuclair.tpl @@ -3,11 +3,11 @@
    - +

    {$block->title}

    {$block->content}
    -
    \ No newline at end of file +
    diff --git a/www/themes/versionecologique/modules/advconstructor/category.tpl b/www/themes/versionecologique/modules/advconstructor/category.tpl index 85889df..5f59db1 100644 --- a/www/themes/versionecologique/modules/advconstructor/category.tpl +++ b/www/themes/versionecologique/modules/advconstructor/category.tpl @@ -1,6 +1,6 @@
    - +

    {$block->title}

    diff --git a/www/themes/versionecologique/modules/advconstructor/footer.tpl b/www/themes/versionecologique/modules/advconstructor/footer.tpl index 4c6bd75..808bbd4 100644 --- a/www/themes/versionecologique/modules/advconstructor/footer.tpl +++ b/www/themes/versionecologique/modules/advconstructor/footer.tpl @@ -1,6 +1,6 @@
    - {**} + {**}

    {$block->title}

    diff --git a/www/themes/versionecologique/modules/advconstructor/footerright.tpl b/www/themes/versionecologique/modules/advconstructor/footerright.tpl index 1cc33b5..adfcc5d 100644 --- a/www/themes/versionecologique/modules/advconstructor/footerright.tpl +++ b/www/themes/versionecologique/modules/advconstructor/footerright.tpl @@ -1,6 +1,6 @@
    - {**} + {**}

    {$block->title}

    @@ -13,7 +13,7 @@