first commit

This commit is contained in:
2024-12-17 13:43:22 +01:00
commit 8e6cd8b410
21292 changed files with 3514826 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
![alt tag](views/img/ga_logo.png)
## About
Gain clear insights into important metrics about your customers, using Google Analytics.
To use it, you will need to create a Google Analytics account and insert your Google Analytics Identifier into the Module configuration page.
### Notes
Enhanced Ecommerce must be enabled in Google Analytics settings for full functionality. Otherwise, some data (refunds etc.) will not be visible. Follow [the related instructions][4].
### Configure
1. Install the module into your shop.
2. Create an account on Google Analytics if you do not have one.
3. Go on the "Configure" page of the module to insert your Google Analytics Identifier.
4. The data will then be sent to Google Analytics and you can monitor/explore it.
## 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.7 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 ps_googleanalytics 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
[4]: https://support.google.com/analytics/answer/6032539

View File

@@ -0,0 +1,113 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
namespace PrestaShop\Module\Ps_Googleanalytics\Database;
use Configuration;
use Db;
use Ps_Googleanalytics;
use Shop;
class Install
{
/**
* @var Ps_Googleanalytics
*/
private $module;
public function __construct(Ps_Googleanalytics $module)
{
if (Shop::isFeatureActive()) {
Shop::setContext(Shop::CONTEXT_ALL);
}
$this->module = $module;
}
/**
* installTables
*
* @return bool
*/
public function installTables()
{
$sql = [];
$sql[] = '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,
`refund_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';
$sql[] = 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'ganalytics_data` (
`id_cart` int(11) NOT NULL,
`id_shop` int(11) NOT NULL,
`data` TEXT DEFAULT NULL,
PRIMARY KEY (`id_cart`)
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8';
foreach ($sql as $query) {
if (!Db::getInstance()->execute($query)) {
return false;
}
}
return true;
}
/**
* Insert default data to database
*
* @return bool
*/
public function setDefaultConfiguration()
{
Configuration::updateValue('GA_CANCELLED_STATES', json_encode([Configuration::get('PS_OS_CANCELED')]));
return true;
}
/**
* Register Module hooks
*
* @return bool
*/
public function registerHooks()
{
return $this->module->registerHook('displayHeader') &&
$this->module->registerHook('displayAdminOrder') &&
$this->module->registerHook('displayFooter') &&
$this->module->registerHook('displayHome') &&
$this->module->registerHook('displayFooterProduct') &&
$this->module->registerHook('displayOrderConfirmation') &&
$this->module->registerHook('actionProductCancel') &&
$this->module->registerHook('actionOrderStatusPostUpdate') &&
$this->module->registerHook('actionCartSave') &&
$this->module->registerHook('displayBackOfficeHeader') &&
$this->module->registerHook('actionCarrierProcess');
}
}

View File

@@ -0,0 +1,45 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
namespace PrestaShop\Module\Ps_Googleanalytics\Database;
use Db;
class Uninstall
{
/**
* uninstallTables
*
* @return bool
*/
public function uninstallTables()
{
$sql[] = 'DROP TABLE IF EXISTS `' . _DB_PREFIX_ . 'ganalytics`';
$sql[] = 'DROP TABLE IF EXISTS `' . _DB_PREFIX_ . 'ganalytics_data`';
foreach ($sql as $query) {
if (!Db::getInstance()->execute($query)) {
return false;
}
}
return true;
}
}

View File

@@ -0,0 +1,28 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (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;

View File

@@ -0,0 +1,250 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
namespace PrestaShop\Module\Ps_Googleanalytics\Form;
use AdminController;
use Configuration;
use Context;
use HelperForm;
use OrderState;
use Ps_Googleanalytics;
use Shop;
use Tools;
class ConfigurationForm
{
private $module;
public function __construct(Ps_Googleanalytics $module)
{
$this->module = $module;
}
/**
* generate
*
* @return string
*/
public function generate()
{
// Check if multistore is active
$is_multistore_active = Shop::isFeatureActive();
// Get default language
$default_lang = (int) Configuration::get('PS_LANG_DEFAULT');
$helper = new HelperForm();
// Module, token and currentIndex
$helper->module = $this->module;
$helper->name_controller = $this->module->name;
$helper->token = Tools::getAdminTokenLite('AdminModules');
$helper->currentIndex = AdminController::$currentIndex . '&configure=' . $this->module->name;
// Language
$helper->default_form_language = $default_lang;
$helper->allow_employee_form_lang = $default_lang;
// Title and toolbar
$helper->title = $this->module->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->module->name;
$helper->toolbar_btn = [
'save' => [
'desc' => $this->module->l('Save'),
'href' => AdminController::$currentIndex . '&configure=' . $this->module->name . '&save=' . $this->module->name .
'&token=' . Tools::getAdminTokenLite('AdminModules'),
],
'back' => [
'href' => AdminController::$currentIndex . '&token=' . Tools::getAdminTokenLite('AdminModules'),
'desc' => $this->module->l('Back to list'),
],
];
$fields_form = [];
// Init Fields form array
$fields_form[0]['form'] = [
'legend' => [
'title' => $this->module->l('Settings'),
],
'input' => [
[
'type' => 'text',
'label' => $this->module->l('Google Analytics Tracking ID'),
'name' => 'GA_ACCOUNT_ID',
'size' => 20,
'required' => true,
'hint' => $this->module->l('This information is available in your Google Analytics account'),
],
[
'type' => 'switch',
'label' => $this->module->l('Enable User ID tracking'),
'name' => 'GA_USERID_ENABLED',
'values' => [
[
'id' => 'ga_userid_enabled',
'value' => 1,
'label' => $this->module->l('Yes'),
],
[
'id' => 'ga_userid_disabled',
'value' => 0,
'label' => $this->module->l('No'),
], ],
],
[
'type' => 'switch',
'label' => $this->module->l('Anonymize IP'),
'name' => 'GA_ANONYMIZE_ENABLED',
'hint' => $this->module->l('Use this option to anonymize the visitors IP to comply with data privacy laws in some countries'),
'values' => [
[
'id' => 'ga_anonymize_enabled',
'value' => 1,
'label' => $this->module->l('Yes'),
],
[
'id' => 'ga_anonymize_disabled',
'value' => 0,
'label' => $this->module->l('No'),
],
],
],
[
'type' => 'switch',
'label' => $this->module->l('Enable Back Office Tracking'),
'name' => 'GA_TRACK_BACKOFFICE_ENABLED',
'hint' => $this->module->l('Use this option to enable the tracking inside the Back Office'),
'values' => [
[
'id' => 'ga_track_backoffice',
'value' => 1,
'label' => $this->module->l('Yes'),
],
[
'id' => 'ga_do_not_track_backoffice',
'value' => 0,
'label' => $this->module->l('No'),
],
],
],
[
'type' => 'select',
'label' => $this->module->l('Cancelled order states'),
'name' => 'GA_CANCELLED_STATES',
'desc' => $this->module->l('Choose order states, in which you consider the given order cancelled. This will be usually only the default "Cancelled" state, but some shops may have extra states like "Returned" etc.'),
'class' => 'chosen',
'multiple' => true,
'options' => [
'query' => OrderState::getOrderStates((int) Context::getContext()->language->id),
'id' => 'id_order_state',
'name' => 'name',
],
],
],
'submit' => [
'title' => $this->module->l('Save'),
],
];
if ($is_multistore_active) {
$fields_form[0]['form']['input'][] = [
'type' => 'switch',
'label' => $this->module->l('Enable Cross-Domain tracking'),
'name' => 'GA_CROSSDOMAIN_ENABLED',
'values' => [
[
'id' => 'ga_crossdomain_enabled',
'value' => 1,
'label' => $this->module->l('Yes'),
],
[
'id' => 'ga_crossdomain_disabled',
'value' => 0,
'label' => $this->module->l('No'),
],
],
];
}
// 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');
$helper->fields_value['GA_CROSSDOMAIN_ENABLED'] = Configuration::get('GA_CROSSDOMAIN_ENABLED');
$helper->fields_value['GA_ANONYMIZE_ENABLED'] = Configuration::get('GA_ANONYMIZE_ENABLED');
$helper->fields_value['GA_TRACK_BACKOFFICE_ENABLED'] = Configuration::get('GA_TRACK_BACKOFFICE_ENABLED');
$helper->fields_value['GA_CANCELLED_STATES[]'] = json_decode(Configuration::get('GA_CANCELLED_STATES'), true);
return $helper->generateForm($fields_form);
}
/**
* treat the form datas if submited
*
* @return string
*/
public function treat()
{
$treatmentResult = '';
$gaAccountId = Tools::getValue('GA_ACCOUNT_ID');
$gaUserIdEnabled = Tools::getValue('GA_USERID_ENABLED');
$gaCrossdomainEnabled = Tools::getValue('GA_CROSSDOMAIN_ENABLED');
$gaAnonymizeEnabled = Tools::getValue('GA_ANONYMIZE_ENABLED');
$gaTrackBackOffice = Tools::getValue('GA_TRACK_BACKOFFICE_ENABLED');
$gaCancelledStates = Tools::getValue('GA_CANCELLED_STATES');
if (!empty($gaAccountId)) {
Configuration::updateValue('GA_ACCOUNT_ID', $gaAccountId);
Configuration::updateValue('GANALYTICS_CONFIGURATION_OK', true);
$treatmentResult .= $this->module->displayConfirmation($this->module->l('Account ID updated successfully'));
}
if (null !== $gaUserIdEnabled) {
Configuration::updateValue('GA_USERID_ENABLED', (bool) $gaUserIdEnabled);
$treatmentResult .= $this->module->displayConfirmation($this->module->l('Settings for User ID updated successfully'));
}
if (null !== $gaCrossdomainEnabled) {
Configuration::updateValue('GA_CROSSDOMAIN_ENABLED', (bool) $gaCrossdomainEnabled);
$treatmentResult .= $this->module->displayConfirmation($this->module->l('Settings for User ID updated successfully'));
}
if (null !== $gaAnonymizeEnabled) {
Configuration::updateValue('GA_ANONYMIZE_ENABLED', (bool) $gaAnonymizeEnabled);
$treatmentResult .= $this->module->displayConfirmation($this->module->l('Settings for Anonymize IP updated successfully'));
}
if (null !== $gaTrackBackOffice) {
Configuration::updateValue('GA_TRACK_BACKOFFICE_ENABLED', (bool) $gaTrackBackOffice);
$treatmentResult .= $this->module->displayConfirmation($this->module->l('Settings for Enable Back Office tracking updated successfully'));
}
if ($gaCancelledStates === false) {
Configuration::updateValue('GA_CANCELLED_STATES', '');
} else {
Configuration::updateValue('GA_CANCELLED_STATES', json_encode($gaCancelledStates));
}
$treatmentResult .= $this->module->displayConfirmation($this->module->l('Settings for cancelled order states updated successfully'));
return $treatmentResult;
}
}

View File

@@ -0,0 +1,28 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (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;

View File

@@ -0,0 +1,147 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
namespace PrestaShop\Module\Ps_Googleanalytics;
class GoogleAnalyticsTools
{
/**
* filter
*
* @param string $gaScripts
* @param int $filterable
*
* @return string
*/
public function filter($gaScripts, $filterable)
{
if (1 == $filterable) {
return implode(';', array_unique(explode(';', $gaScripts)));
}
return $gaScripts;
}
/**
* add order transaction
*
* @param array $products
* @param array $order
*
* @return string|void
*/
public function addTransaction($products, $order)
{
if (!is_array($products)) {
return;
}
$js = '';
foreach ($products as $product) {
$js .= 'MBG.add(' . json_encode($product) . ');';
}
return $js . 'MBG.addTransaction(' . json_encode($order) . ');';
}
/**
* add product impression js and product click js
*
* @param array $products
*
* @return string|void
*/
public function addProductImpression($products)
{
if (!is_array($products)) {
return;
}
$js = '';
foreach ($products as $product) {
$js .= 'MBG.add(' . json_encode($product) . ",'',true);";
}
return $js;
}
/**
* addProductClick
*
* @param array $products
*
* @return string|void
*/
public function addProductClick($products)
{
if (!is_array($products)) {
return;
}
$js = '';
foreach ($products as $product) {
$js .= 'MBG.addProductClick(' . json_encode($product) . ');';
}
return $js;
}
/**
* addProductClickByHttpReferal
*
* @param array $products
*
* @return string|void
*/
public function addProductClickByHttpReferal($products)
{
if (!is_array($products)) {
return;
}
$js = '';
foreach ($products as $product) {
$js .= 'MBG.addProductClickByHttpReferal(' . json_encode($product) . ');';
}
return $js;
}
/**
* Add product checkout info
*
* @param array $products
*
* @return string|void
*/
public function addProductFromCheckout($products)
{
if (!is_array($products)) {
return;
}
$js = '';
foreach ($products as $product) {
$js .= 'MBG.add(' . json_encode($product) . ');';
}
return $js;
}
}

View File

@@ -0,0 +1,143 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
namespace PrestaShop\Module\Ps_Googleanalytics\Handler;
use PrestaShop\Module\Ps_Googleanalytics\Repository\GanalyticsDataRepository;
class GanalyticsDataHandler
{
private $ganalyticsDataRepository;
private $cartId;
private $shopId;
/**
* __construct
*
* @param int $cartId
* @param int $shopId
*/
public function __construct($cartId, $shopId)
{
$this->ganalyticsDataRepository = new GanalyticsDataRepository();
$this->cartId = (int) $cartId;
$this->shopId = (int) $shopId;
}
/**
* manageData
*
* @param string|array $data
* @param string $action
*
* @return mixed
*/
public function manageData($data, $action)
{
if ('R' === $action) {
return $this->readData();
}
if ('W' === $action) {
return $this->ganalyticsDataRepository->addNewRow(
(int) $this->cartId,
(int) $this->shopId,
json_encode($data)
);
}
if ('A' === $action) {
return $this->appendData($data);
}
if ('D' === $action) {
return $this->ganalyticsDataRepository->deleteRow(
$this->cartId,
$this->shopId
);
}
return false;
}
/**
* readData
*
* @return array
*/
private function readData()
{
$dataReturned = $this->ganalyticsDataRepository->findDataByCartIdAndShopId(
$this->cartId,
$this->shopId
);
if (false === $dataReturned) {
return [];
}
return $this->jsonDecodeValidJson($dataReturned);
}
/**
* appendData
*
* @param string $data
*
* @return bool
*/
private function appendData($data)
{
$dataReturned = $this->ganalyticsDataRepository->findDataByCartIdAndShopId(
$this->cartId,
$this->shopId
);
if (false === $dataReturned) {
$newData = [$data];
} else {
$newData[] = $this->jsonDecodeValidJson($dataReturned);
}
return $this->ganalyticsDataRepository->addNewRow(
(int) $this->cartId,
(int) $this->shopId,
json_encode($newData)
);
}
/**
* Check if the json is valid and returns an empty array if not
*
* @param string $json
*
* @return array
*/
protected function jsonDecodeValidJson($json)
{
$array = json_decode($json, true);
if (JSON_ERROR_NONE === json_last_error()) {
return $array;
}
return [];
}
}

View File

@@ -0,0 +1,65 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
namespace PrestaShop\Module\Ps_Googleanalytics\Handler;
use Configuration;
use Context;
use Ps_Googleanalytics;
use Tools;
class GanalyticsJsHandler
{
private $module;
private $context;
public function __construct(Ps_Googleanalytics $module, Context $context)
{
$this->module = $module;
$this->context = $context;
}
/**
* Generate Google Analytics js
*
* @param string $jsCode
* @param bool $isBackoffice
*
* @return void|string
*/
public function generate($jsCode, $isBackoffice = false)
{
if (Configuration::get('GA_ACCOUNT_ID')) {
$this->context->smarty->assign(
[
'jsCode' => $jsCode,
'isoCode' => Tools::safeOutput($this->context->currency->iso_code),
'jsState' => $this->module->js_state,
'isBackoffice' => $isBackoffice,
]
);
return $this->module->display(
$this->module->getLocalPath() . $this->module->name,
'ga_tag.tpl'
);
}
}
}

View File

@@ -0,0 +1,98 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
namespace PrestaShop\Module\Ps_Googleanalytics\Handler;
use Module;
class ModuleHandler
{
/**
* @param string $moduleName
*
* @return bool
*/
public function isModuleEnabled($moduleName)
{
$module = Module::getInstanceByName($moduleName);
if (!($module instanceof Module)) {
return false;
}
if (false === Module::isInstalled($moduleName)) {
return false;
}
if (false === $module->active) {
return false;
}
return true;
}
/**
* @param string $moduleName
* @param string $hookName
*
* @return bool
*/
public function isModuleEnabledAndHookedOn($moduleName, $hookName)
{
$module = Module::getInstanceByName($moduleName);
if (false === $this->isModuleEnabled($moduleName)) {
return false;
}
return $module->isRegisteredInHook($hookName);
}
/**
* @param string $moduleName
*
* @return bool
*/
public function uninstallModule($moduleName)
{
if (false === Module::isInstalled($moduleName)) {
return false;
}
$oldModule = Module::getInstanceByName($moduleName);
if (!($oldModule instanceof Module)) {
return false;
}
if (method_exists($oldModule, 'uninstallTab')) {
$oldModule->uninstallTab();
}
// This closure calls the parent class to prevent data to be erased
$parentUninstallClosure = function () {
return parent::uninstall();
};
$parentUninstallClosure = $parentUninstallClosure->bindTo($oldModule, get_class($oldModule));
return $parentUninstallClosure();
}
}

View File

@@ -0,0 +1,28 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (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;

View File

@@ -0,0 +1,68 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
namespace PrestaShop\Module\Ps_Googleanalytics\Hooks;
use Context;
use PrestaShop\Module\Ps_Googleanalytics\Handler\GanalyticsDataHandler;
use PrestaShop\Module\Ps_Googleanalytics\Repository\CarrierRepository;
use Ps_Googleanalytics;
class HookActionCarrierProcess implements HookInterface
{
private $module;
private $context;
private $params;
public function __construct(Ps_Googleanalytics $module, Context $context)
{
$this->module = $module;
$this->context = $context;
}
/**
* run
*
* @return void
*/
public function run()
{
if (isset($this->params['cart']->id_carrier)) {
$carrierRepository = new CarrierRepository();
$ganalyticsDataHandler = new GanalyticsDataHandler(
$this->context->cart->id,
$this->context->shop->id
);
$carrierName = $carrierRepository->findByCarrierId((int) $this->params['cart']->id_carrier);
$ganalyticsDataHandler->manageData('MBG.addCheckoutOption(2,\'' . $carrierName . '\');', 'A');
}
}
/**
* setParams
*
* @param array $params
*/
public function setParams($params)
{
$this->params = $params;
}
}

View File

@@ -0,0 +1,136 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
namespace PrestaShop\Module\Ps_Googleanalytics\Hooks;
use Configuration;
use Context;
use PrestaShop\Module\Ps_Googleanalytics\Handler\GanalyticsDataHandler;
use PrestaShop\Module\Ps_Googleanalytics\Wrapper\ProductWrapper;
use Product;
use Ps_Googleanalytics;
use Tools;
use Validate;
class HookActionCartSave implements HookInterface
{
private $module;
/**
* @var Context
*/
private $context;
public function __construct(Ps_Googleanalytics $module, Context $context)
{
$this->module = $module;
$this->context = $context;
}
/**
* run
*
* @return void
*/
public function run()
{
if (!isset($this->context->cart)) {
return;
}
if (!Tools::getIsset('id_product')) {
return;
}
$cart = [
'controller' => Tools::getValue('controller'),
'addAction' => Tools::getValue('add') ? 'add' : '',
'removeAction' => Tools::getValue('delete') ? 'delete' : '',
'extraAction' => Tools::getValue('op'),
'qty' => (int) Tools::getValue('qty', 1),
];
$cartProducts = $this->context->cart->getProducts();
if (!empty($cartProducts)) {
foreach ($cartProducts as $cartProduct) {
if ($cartProduct['id_product'] == Tools::getValue('id_product')) {
$addProduct = $cartProduct;
break;
}
}
}
if ($cart['removeAction'] == 'delete') {
$addProductObject = new Product((int) Tools::getValue('id_product'), true, (int) Configuration::get('PS_LANG_DEFAULT'));
if (Validate::isLoadedObject($addProductObject)) {
$addProduct['name'] = $addProductObject->name;
$addProduct['manufacturer_name'] = $addProductObject->manufacturer_name;
$addProduct['category'] = $addProductObject->category;
$addProduct['reference'] = $addProductObject->reference;
$addProduct['link_rewrite'] = $addProductObject->link_rewrite;
$addProduct['link'] = $addProductObject->link_rewrite;
$addProduct['price'] = $addProductObject->price;
$addProduct['ean13'] = $addProductObject->ean13;
$addProduct['id_product'] = Tools::getValue('id_product');
$addProduct['id_category_default'] = $addProductObject->id_category_default;
$addProduct['out_of_stock'] = $addProductObject->out_of_stock;
$addProduct['minimal_quantity'] = 1;
$addProduct['unit_price_ratio'] = 0;
$addProduct = Product::getProductProperties((int) Configuration::get('PS_LANG_DEFAULT'), $addProduct);
}
}
if (isset($addProduct) && !in_array((int) Tools::getValue('id_product'), $this->module->products)) {
$ganalyticsDataHandler = new GanalyticsDataHandler(
$this->context->cart->id,
$this->context->shop->id
);
$this->module->products[] = (int) Tools::getValue('id_product');
$productWrapper = new ProductWrapper($this->context);
$gaProducts = $productWrapper->wrapProduct($addProduct, $cart, 0, true);
if (array_key_exists('id_product_attribute', $gaProducts) && $gaProducts['id_product_attribute'] != '' && $gaProducts['id_product_attribute'] != 0) {
$productId = $gaProducts['id_product_attribute'];
} else {
$productId = Tools::getValue('id_product');
}
$gaCart = $ganalyticsDataHandler->manageData('', 'R');
if ($cart['removeAction'] == 'delete') {
$gaProducts['quantity'] = -1;
} elseif ($cart['extraAction'] == 'down') {
if (array_key_exists($productId, $gaCart)) {
$gaProducts['quantity'] = $gaCart[$productId]['quantity'] - $cart['qty'];
} else {
$gaProducts['quantity'] = $cart['qty'] * -1;
}
} elseif (Tools::getValue('step') <= 0) { // Sometimes cartsave is called in checkout
if (array_key_exists($productId, $gaCart)) {
$gaProducts['quantity'] = $gaCart[$productId]['quantity'] + $cart['qty'];
}
}
$gaCart[$productId] = $gaProducts;
$ganalyticsDataHandler->manageData($gaCart, 'W');
}
}
}

View File

@@ -0,0 +1,96 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
namespace PrestaShop\Module\Ps_Googleanalytics\Hooks;
use Configuration;
use Context;
use Db;
use Ps_Googleanalytics;
class HookActionOrderStatusPostUpdate implements HookInterface
{
/**
* @var Ps_Googleanalytics
*/
private $module;
/**
* @var Context
*/
private $context;
/**
* @var array
*/
private $params;
public function __construct(Ps_Googleanalytics $module, Context $context)
{
$this->module = $module;
$this->context = $context;
}
/**
* run
*
* @return void
*/
public function run()
{
// If we do not have an order or a new order status, we return
if (empty($this->params['id_order']) || empty($this->params['newOrderStatus']->id)) {
return;
}
// We get all states in which the merchant want to have refund sent and check if the new state being set belongs there
$gaCancelledStates = json_decode(Configuration::get('GA_CANCELLED_STATES'), true);
if (empty($gaCancelledStates) || !in_array($this->params['newOrderStatus']->id, $gaCancelledStates)) {
return;
}
// We check if the refund was already sent to Google Analytics
$gaRefundSent = Db::getInstance()->getValue(
'SELECT id_order FROM `' . _DB_PREFIX_ . 'ganalytics` WHERE id_order = ' . (int) $this->params['id_order'] . ' AND refund_sent = 1'
);
// If it was not already refunded
if ($gaRefundSent === false) {
// We refund it and set the "sent" flag to true
$this->context->cookie->__set('ga_admin_refund', 'MBG.refundByOrderId(' . json_encode(['id' => $this->params['id_order']]) . ');');
$this->context->cookie->write();
// We save this information to database
Db::getInstance()->execute(
'UPDATE `' . _DB_PREFIX_ . 'ganalytics` SET refund_sent = 1 WHERE id_order = ' . (int) $this->params['id_order']
);
}
}
/**
* setParams
*
* @param array $params
*/
public function setParams($params)
{
$this->params = $params;
}
}

View File

@@ -0,0 +1,75 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
namespace PrestaShop\Module\Ps_Googleanalytics\Hooks;
use Context;
use OrderDetail;
use Ps_Googleanalytics;
class HookActionProductCancel implements HookInterface
{
private $module;
private $context;
private $params;
public function __construct(Ps_Googleanalytics $module, Context $context)
{
$this->module = $module;
$this->context = $context;
}
/**
* run
*
* @return void
*/
public function run()
{
if (!isset($this->params['id_order_detail']) || !isset($this->params['cancel_quantity'])) {
return;
}
// Display GA refund product
$orderDetail = new OrderDetail($this->params['id_order_detail']);
$gaScripts = 'MBG.add(' . json_encode(
[
'id' => empty($orderDetail->product_attribute_id) ? $orderDetail->product_id : $orderDetail->product_id . '-' . $orderDetail->product_attribute_id,
'quantity' => $this->params['cancel_quantity'],
])
. ');';
$this->context->cookie->__set(
'ga_admin_refund',
$gaScripts . 'MBG.refundByProduct(' . json_encode(['id' => $this->params['order']->id]) . ');'
);
$this->context->cookie->write();
}
/**
* setParams
*
* @param array $params
*/
public function setParams($params)
{
$this->params = $params;
}
}

View File

@@ -0,0 +1,111 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
namespace PrestaShop\Module\Ps_Googleanalytics\Hooks;
use Configuration;
use Context;
use Order;
use PrestaShop\Module\Ps_Googleanalytics\Handler\GanalyticsJsHandler;
use PrestaShop\Module\Ps_Googleanalytics\Repository\GanalyticsRepository;
use PrestaShop\Module\Ps_Googleanalytics\Wrapper\OrderWrapper;
use Ps_Googleanalytics;
use Tools;
use Validate;
class HookDisplayBackOfficeHeader implements HookInterface
{
private $module;
private $context;
public function __construct(Ps_Googleanalytics $module, Context $context)
{
$this->module = $module;
$this->context = $context;
}
/**
* run
*
* @return string
*/
public function run()
{
$js = '';
if (strcmp(Tools::getValue('configure'), $this->module->name) === 0) {
$this->context->controller->addCSS($this->module->getPathUri() . 'views/css/ganalytics.css');
}
$ga_account_id = Configuration::get('GA_ACCOUNT_ID');
if (!empty($ga_account_id) && $this->module->active) {
$gaTagHandler = new GanalyticsJsHandler($this->module, $this->context);
$this->context->controller->addJs($this->module->getPathUri() . 'views/js/GoogleAnalyticActionLib.js');
$this->context->smarty->assign('GA_ACCOUNT_ID', $ga_account_id);
$gaScripts = '';
if ($this->context->controller->controller_name == 'AdminOrders') {
$ganalyticsRepository = new GanalyticsRepository();
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()) {
$gaOrderSent = $ganalyticsRepository->findGaOrderByOrderId((int) Tools::getValue('id_order'));
if ($gaOrderSent === false) {
$ganalyticsRepository->addNewRow(
[
'id_order' => (int) Tools::getValue('id_order'),
'id_shop' => (int) $this->context->shop->id,
'sent' => 0,
'date_add' => ['value' => 'NOW()', 'type' => 'sql'],
]
);
}
}
} else {
$gaOrderRecords = $ganalyticsRepository->findAllByShopIdAndDateAdd((int) $this->context->shop->id);
if ($gaOrderRecords) {
$orderWrapper = new OrderWrapper($this->context);
foreach ($gaOrderRecords as $row) {
$transaction = $orderWrapper->wrapOrder($row['id_order']);
if (!empty($transaction)) {
$ganalyticsRepository->updateData(
[
'date_add' => ['value' => 'NOW()', 'type' => 'sql'],
'sent' => 1,
],
'id_order = ' . (int) $row['id_order'] . ' AND id_shop = ' . (int) $this->context->shop->id
);
$transaction = json_encode($transaction);
$gaScripts .= 'MBG.addTransaction(' . $transaction . ');';
}
}
}
}
}
return $js . $this->module->hookdisplayHeader(null, true) . $gaTagHandler->generate($gaScripts, true);
}
return $js;
}
}

View File

@@ -0,0 +1,117 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
namespace PrestaShop\Module\Ps_Googleanalytics\Hooks;
use Context;
use Hook;
use PrestaShop\Module\Ps_Googleanalytics\GoogleAnalyticsTools;
use PrestaShop\Module\Ps_Googleanalytics\Handler\GanalyticsDataHandler;
use PrestaShop\Module\Ps_Googleanalytics\Handler\GanalyticsJsHandler;
use PrestaShop\Module\Ps_Googleanalytics\Wrapper\ProductWrapper;
use Ps_Googleanalytics;
use RecursiveArrayIterator;
use RecursiveIteratorIterator;
use Tools;
class HookDisplayFooter implements HookInterface
{
private $module;
private $context;
public function __construct(Ps_Googleanalytics $module, Context $context)
{
$this->module = $module;
$this->context = $context;
}
/**
* run
*
* @return string
*/
public function run()
{
$gaTools = new GoogleAnalyticsTools();
$gaTagHandler = new GanalyticsJsHandler($this->module, $this->context);
$ganalyticsDataHandler = new GanalyticsDataHandler(
$this->context->cart->id,
$this->context->shop->id
);
$gaScripts = '';
$this->module->js_state = 0;
$gacarts = $ganalyticsDataHandler->manageData('', 'R');
$controller_name = Tools::getValue('controller');
if (count($gacarts) > 0 && $controller_name != 'product') {
$this->module->filterable = 0;
foreach ($gacarts as $gacart) {
if (isset($gacart['quantity'])) {
if ($gacart['quantity'] > 0) {
$gaScripts .= 'MBG.addToCart(' . json_encode($gacart) . ');';
} elseif ($gacart['quantity'] < 0) {
$gacart['quantity'] = abs($gacart['quantity']);
$gaScripts .= 'MBG.removeFromCart(' . json_encode($gacart) . ');';
}
} elseif (is_array($gacart)) {
$it = new RecursiveIteratorIterator(new RecursiveArrayIterator($gacart));
foreach ($it as $v) {
$gaScripts .= $v;
}
} else {
$gaScripts .= $gacart;
}
}
$ganalyticsDataHandler->manageData('', 'D');
}
$listing = $this->context->smarty->getTemplateVars('listing');
$productWrapper = new ProductWrapper($this->context);
$products = $productWrapper->wrapProductList(isset($listing['products']) ? $listing['products'] : [], [], true);
if ($controller_name == 'order' || $controller_name == 'orderopc') {
$this->module->js_state = 1;
$this->module->eligible = 1;
$step = Tools::getValue('step');
if (empty($step)) {
$step = 0;
}
$gaScripts .= $gaTools->addProductFromCheckout($products);
$gaScripts .= 'MBG.addCheckout(\'' . (int) $step . '\');';
}
$confirmation_hook_id = (int) Hook::getIdByName('displayOrderConfirmation');
if (isset(Hook::$executed_hooks[$confirmation_hook_id])) {
$this->module->eligible = 1;
}
if (isset($products) && count($products) && $controller_name != 'index') {
if ($this->module->eligible == 0) {
$gaScripts .= $gaTools->addProductImpression($products);
}
$gaScripts .= $gaTools->addProductClick($products);
}
return $gaTagHandler->generate($gaScripts);
}
}

View File

@@ -0,0 +1,84 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
namespace PrestaShop\Module\Ps_Googleanalytics\Hooks;
use Context;
use PrestaShop\Module\Ps_Googleanalytics\GoogleAnalyticsTools;
use PrestaShop\Module\Ps_Googleanalytics\Handler\GanalyticsJsHandler;
use PrestaShop\Module\Ps_Googleanalytics\Wrapper\ProductWrapper;
use Product;
use Ps_Googleanalytics;
use Tools;
class HookDisplayFooterProduct implements HookInterface
{
private $module;
private $context;
private $params;
public function __construct(Ps_Googleanalytics $module, Context $context)
{
$this->module = $module;
$this->context = $context;
}
/**
* run
*
* @return string
*/
public function run()
{
$gaTools = new GoogleAnalyticsTools();
$gaTagHandler = new GanalyticsJsHandler($this->module, $this->context);
$controllerName = Tools::getValue('controller');
if ('product' !== $controllerName) {
return '';
}
if ($this->params['product'] instanceof Product) {
$this->params['product'] = (array) $this->params['product'];
}
// Add product view
$productWrapper = new ProductWrapper($this->context);
$gaProduct = $productWrapper->wrapProduct($this->params['product'], null, 0, true);
$js = 'MBG.addProductDetailView(' . json_encode($gaProduct) . ');';
if (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST']) > 0) {
$js .= $gaTools->addProductClickByHttpReferal([$gaProduct]);
}
$this->module->js_state = 1;
return $gaTagHandler->generate($js);
}
/**
* setParams
*
* @param array $params
*/
public function setParams($params)
{
$this->params = $params;
}
}

View File

@@ -0,0 +1,122 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
namespace PrestaShop\Module\Ps_Googleanalytics\Hooks;
use Configuration;
use Context;
use Ps_Googleanalytics;
use Shop;
use Tools;
class HookDisplayHeader implements HookInterface
{
private $module;
private $context;
private $params;
/**
* @var bool
*/
private $backOffice;
public function __construct(Ps_Googleanalytics $module, Context $context)
{
$this->module = $module;
$this->context = $context;
}
/**
* run
*
* @return void|string
*/
public function run()
{
if (!Configuration::get('GA_ACCOUNT_ID')) {
return '';
}
$this->context->controller->addJs($this->module->getPathUri() . 'views/js/GoogleAnalyticActionLib.js');
$shops = Shop::getShops();
$isMultistoreActive = Shop::isFeatureActive();
$currentShopId = (int) Context::getContext()->shop->id;
$userId = null;
$gaCrossdomainEnabled = false;
if (Configuration::get('GA_USERID_ENABLED') &&
$this->context->customer && $this->context->customer->isLogged()
) {
$userId = (int) $this->context->customer->id;
}
$gaAnonymizeEnabled = Configuration::get('GA_ANONYMIZE_ENABLED');
if ((int) Configuration::get('GA_CROSSDOMAIN_ENABLED') && $isMultistoreActive && count($shops) > 1) {
$gaCrossdomainEnabled = true;
}
$this->context->smarty->assign(
[
'backOffice' => $this->backOffice,
'trackBackOffice' => Configuration::get('GA_TRACK_BACKOFFICE_ENABLED'),
'currentShopId' => $currentShopId,
'userId' => $userId,
'gaAccountId' => Tools::safeOutput(Configuration::get('GA_ACCOUNT_ID')),
'shops' => $shops,
'gaCrossdomainEnabled' => $gaCrossdomainEnabled,
'gaAnonymizeEnabled' => $gaAnonymizeEnabled,
'useSecureMode' => Configuration::get('PS_SSL_ENABLED'),
]
);
return $this->module->display(
$this->module->getLocalPath() . $this->module->name,
'ps_googleanalytics.tpl'
);
}
/**
* setParams
*
* @param array $params
*/
public function setParams($params)
{
$this->module->params = $params;
}
/**
* @param bool $backOffice
*/
public function setBackOffice($backOffice)
{
$this->acknowledgeBackOfficeContext($backOffice);
}
/**
* @param bool $isBackOffice
*/
public function acknowledgeBackOfficeContext($isBackOffice)
{
$this->backOffice = $isBackOffice;
}
}

View File

@@ -0,0 +1,78 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
namespace PrestaShop\Module\Ps_Googleanalytics\Hooks;
use Category;
use Configuration;
use Context;
use PrestaShop\Module\Ps_Googleanalytics\GoogleAnalyticsTools;
use PrestaShop\Module\Ps_Googleanalytics\Handler\GanalyticsJsHandler;
use PrestaShop\Module\Ps_Googleanalytics\Handler\ModuleHandler;
use PrestaShop\Module\Ps_Googleanalytics\Wrapper\ProductWrapper;
use Ps_Googleanalytics;
class HookDisplayHome implements HookInterface
{
private $module;
private $context;
public function __construct(Ps_Googleanalytics $module, Context $context)
{
$this->module = $module;
$this->context = $context;
}
/**
* run
*
* @return string
*/
public function run()
{
$moduleHandler = new ModuleHandler();
$gaTools = new GoogleAnalyticsTools();
$gaTagHandler = new GanalyticsJsHandler($this->module, $this->context);
$gaScripts = '';
// Home featured products
if ($moduleHandler->isModuleEnabledAndHookedOn('ps_featuredproducts', 'displayHome')) {
$category = new Category($this->context->shop->getCategory(), $this->context->language->id);
$productWrapper = new ProductWrapper($this->context);
$homeFeaturedProducts = $productWrapper->wrapProductList(
$category->getProducts(
(int) $this->context->language->id,
1,
(Configuration::get('HOME_FEATURED_NBR') ? (int) Configuration::get('HOME_FEATURED_NBR') : 8),
'position'
),
[],
true
);
$gaScripts .= $gaTools->addProductImpression($homeFeaturedProducts) . $gaTools->addProductClick($homeFeaturedProducts);
}
$this->module->js_state = 1;
return $gaTagHandler->generate(
$gaTools->filter($gaScripts, $this->module->filterable)
);
}
}

View File

@@ -0,0 +1,114 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
namespace PrestaShop\Module\Ps_Googleanalytics\Hooks;
use Cart;
use Configuration;
use Context;
use PrestaShop\Module\Ps_Googleanalytics\GoogleAnalyticsTools;
use PrestaShop\Module\Ps_Googleanalytics\Handler\GanalyticsJsHandler;
use PrestaShop\Module\Ps_Googleanalytics\Repository\GanalyticsRepository;
use PrestaShop\Module\Ps_Googleanalytics\Wrapper\ProductWrapper;
use Ps_Googleanalytics;
use Shop;
use Validate;
class HookDisplayOrderConfirmation implements HookInterface
{
private $module;
private $context;
private $params;
public function __construct(Ps_Googleanalytics $module, Context $context)
{
$this->module = $module;
$this->context = $context;
}
/**
* run
*
* @return string
*/
public function run()
{
if (true === $this->module->psVersionIs17) {
$order = $this->params['order'];
} else {
$order = $this->params['objOrder'];
}
if (Validate::isLoadedObject($order) && $order->getCurrentState() != (int) Configuration::get('PS_OS_ERROR')) {
$ganalyticsRepository = new GanalyticsRepository();
$gaOrderSent = $ganalyticsRepository->findGaOrderByOrderId((int) $order->id);
if (false === $gaOrderSent) {
$ganalyticsRepository->addNewRow(
[
'id_order' => (int) $order->id,
'id_shop' => (int) $this->context->shop->id,
'sent' => 0,
'date_add' => ['value' => 'NOW()', 'type' => 'sql'],
]
);
if ($order->id_customer == $this->context->cookie->id_customer) {
$orderProducts = [];
$cart = new Cart($order->id_cart);
$gaTools = new GoogleAnalyticsTools();
$gaTagHandler = new GanalyticsJsHandler($this->module, $this->context);
$productWrapper = new ProductWrapper($this->context);
foreach ($cart->getProducts() as $order_product) {
$orderProducts[] = $productWrapper->wrapProduct($order_product, [], 0, true);
}
$gaScripts = 'MBG.addCheckoutOption(3,\'' . $order->payment . '\');';
$transaction = [
'id' => $order->id,
'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->getModuleLink('ps_googleanalytics', 'ajax', [], true),
'customer' => $order->id_customer, ];
$gaScripts .= $gaTools->addTransaction($orderProducts, $transaction);
$this->module->js_state = 1;
return $gaTagHandler->generate($gaScripts);
}
}
}
return '';
}
/**
* setParams
*
* @param array $params
*/
public function setParams($params)
{
$this->params = $params;
}
}

View File

@@ -0,0 +1,35 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
namespace PrestaShop\Module\Ps_Googleanalytics\Hooks;
use Context;
use Ps_Googleanalytics;
interface HookInterface
{
/**
* @param Ps_Googleanalytics $module
* @param Context $context
*/
public function __construct(Ps_Googleanalytics $module, Context $context);
public function run();
}

View File

@@ -0,0 +1,28 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (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;

View File

@@ -0,0 +1,44 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
namespace PrestaShop\Module\Ps_Googleanalytics\Repository;
use Db;
class CarrierRepository
{
const TABLE_NAME = 'carrier';
/**
* findByCarrierId
*
* @param int $carrierId
*
* @return string
*/
public function findByCarrierId($carrierId)
{
return Db::getInstance()->getValue(
'SELECT name
FROM `' . _DB_PREFIX_ . self::TABLE_NAME . '`
WHERE id_carrier = ' . (int) $carrierId
);
}
}

View File

@@ -0,0 +1,80 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
namespace PrestaShop\Module\Ps_Googleanalytics\Repository;
use Db;
class GanalyticsDataRepository
{
const TABLE_NAME = 'ganalytics_data';
/**
* findByCartId
*
* @param int $cartId
* @param int $shopId
*
* @return mixed
*/
public function findDataByCartIdAndShopId($cartId, $shopId)
{
return Db::getInstance()->getValue(
'SELECT data
FROM `' . _DB_PREFIX_ . self::TABLE_NAME . '`
WHERE id_cart = ' . (int) $cartId . '
AND id_shop = ' . (int) $shopId
);
}
/**
* addNewRow
*
* @param int $cartId
* @param int $shopId
* @param string $data
*
* @return bool
*/
public function addNewRow($cartId, $shopId, $data)
{
return Db::getInstance()->Execute(
'INSERT INTO `' . _DB_PREFIX_ . self::TABLE_NAME . '` (id_cart, id_shop, data)
VALUES(\'' . (int) $cartId . '\',\'' . (int) $shopId . '\',\'' . pSQL($data) . '\')
ON DUPLICATE KEY UPDATE data = \'' . pSQL($data) . '\';'
);
}
/**
* deleteRow
*
* @param int $cartId
* @param int $shopId
*
* @return bool
*/
public function deleteRow($cartId, $shopId)
{
return Db::getInstance()->delete(
self::TABLE_NAME,
'id_cart = ' . (int) $cartId . ' AND id_shop = ' . (int) $shopId
);
}
}

View File

@@ -0,0 +1,99 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
namespace PrestaShop\Module\Ps_Googleanalytics\Repository;
use Db;
class GanalyticsRepository
{
const TABLE_NAME = 'ganalytics';
/**
* findGaOrderByOrderId
*
* @param int $orderId
*
* @return mixed
*/
public function findGaOrderByOrderId($orderId)
{
return Db::getInstance()->getValue(
'SELECT id_order
FROM `' . _DB_PREFIX_ . self::TABLE_NAME . '`
WHERE id_order = ' . (int) $orderId);
}
/**
* findAllByShopIdAndDateAdd
*
* @param int $shopId
*
* @return array
*/
public function findAllByShopIdAndDateAdd($shopId)
{
return Db::getInstance()->ExecuteS(
'SELECT *
FROM `' . _DB_PREFIX_ . self::TABLE_NAME . '`
WHERE sent = 0
AND id_shop = ' . (int) $shopId . '
AND DATE_ADD(date_add, INTERVAL 30 minute) < NOW()'
);
}
/**
* addNewRow
*
* @param array $data
* @param int $type
*
* @return bool
*/
public function addNewRow(array $data, $type = Db::INSERT_IGNORE)
{
return Db::getInstance()->insert(
self::TABLE_NAME,
$data,
false,
true,
$type
);
}
/**
* updateData
*
* @param array $data
* @param string $where
* @param int $limit
*
* @return bool
*/
public function updateData($data, $where, $limit = 0)
{
return Db::getInstance()->update(
self::TABLE_NAME,
$data,
$where,
$limit
);
}
}

View File

@@ -0,0 +1,28 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (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;

View File

@@ -0,0 +1,58 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
namespace PrestaShop\Module\Ps_Googleanalytics\Wrapper;
use Configuration;
use Context;
use Order;
use PrestaShop\Module\Ps_Googleanalytics\Hooks\WrapperInterface;
use Shop;
use Validate;
class OrderWrapper implements WrapperInterface
{
private $context;
public function __construct(Context $context)
{
$this->context = $context;
}
/**
* Return a detailed transaction for Google Analytics
*/
public function wrapOrder($id_order)
{
$order = new Order((int) $id_order);
if (Validate::isLoadedObject($order)) {
return [
'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,
];
}
}
}

View File

@@ -0,0 +1,133 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
namespace PrestaShop\Module\Ps_Googleanalytics\Wrapper;
use Context;
use Currency;
use PrestaShop\Module\Ps_Googleanalytics\Hooks\WrapperInterface;
use Product;
use Tools;
class ProductWrapper implements WrapperInterface
{
private $context;
public function __construct(Context $context)
{
$this->context = $context;
}
/**
* wrap products to provide a standard products information for google analytics script
*/
public function wrapProductList($products, $extras = [], $full = false)
{
$result_products = [];
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'];
} elseif (!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 = [
'id' => $product_id,
'name' => Tools::str2url($product['name']),
'category' => Tools::str2url($product['category']),
'brand' => isset($product['manufacturer_name']) ? Tools::str2url($product['manufacturer_name']) : '',
'variant' => Tools::str2url($variant),
'type' => $product_type,
'position' => $index ? $index : '0',
'quantity' => $product_qty,
'list' => Tools::getValue('controller'),
'url' => isset($product['link']) ? urlencode($product['link']) : '',
'price' => $product['price'],
];
} else {
$ga_product = [
'id' => $product_id,
'name' => Tools::str2url($product['name']),
];
}
return $ga_product;
}
}

View File

@@ -0,0 +1,31 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
namespace PrestaShop\Module\Ps_Googleanalytics\Hooks;
use Context;
interface WrapperInterface
{
/**
* @param Context $context
*/
public function __construct(Context $context);
}

View File

@@ -0,0 +1,28 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (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;

View File

@@ -0,0 +1,28 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (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;

View File

@@ -0,0 +1,35 @@
{
"name": "prestashop/ps_googleanalytics",
"description": "PrestaShop module ps_googleanalytics",
"homepage": "https://github.com/PrestaShop/ps_googleanalytics",
"license": "AFL-3.0",
"authors": [
{
"name": "PrestaShop SA",
"email": "contact@prestashop.com"
}
],
"require": {
"php": ">=5.6"
},
"require-dev": {
"prestashop/php-dev-tools": "3.*"
},
"config": {
"preferred-install": "dist",
"optimize-autoloader": true,
"prepend-autoloader": false,
"platform": {
"php": "5.6"
}
},
"autoload": {
"classmap": [
"ps_googleanalytics.php",
"controllers",
"classes"
]
},
"type": "prestashop-module",
"author": "PrestaShop"
}

1506
modules/ps_googleanalytics/composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>ps_googleanalytics</name>
<displayName><![CDATA[Google Analytics]]></displayName>
<version><![CDATA[4.1.2]]></version>
<description><![CDATA[Gain clear insights into important metrics about your customers, using Google Analytics]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[analytics_stats]]></tab>
<confirmUninstall><![CDATA[Are you sure you want to uninstall Google Analytics? You will lose all the data related to this module.]]></confirmUninstall>
<is_configurable>1</is_configurable>
<need_instance>1</need_instance>
<limited_countries></limited_countries>
</module>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>ps_googleanalytics</name>
<displayName><![CDATA[Google Analytics]]></displayName>
<version><![CDATA[4.1.2]]></version>
<description><![CDATA[Gain clear insights into important metrics about your customers, using Google Analytics]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[analytics_stats]]></tab>
<confirmUninstall><![CDATA[Are you sure you want to uninstall Google Analytics? You will lose all the data related to this module.]]></confirmUninstall>
<is_configurable>1</is_configurable>
<need_instance>1</need_instance>
<limited_countries></limited_countries>
</module>

View File

@@ -0,0 +1,46 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
use PrestaShop\Module\Ps_Googleanalytics\Repository\GanalyticsRepository;
class AdminGanalyticsAjaxController extends ModuleAdminController
{
public $ssl = true;
public function init()
{
$orderId = (int) Tools::getValue('orderid');
$order = new Order($orderId);
if (Validate::isLoadedObject($order) && (isset($this->context->employee->id) && $this->context->employee->id)) {
(new GanalyticsRepository())->updateData(
[
'sent' => 1,
'date_add' => ['value' => 'NOW()', 'type' => 'sql'],
],
'id_order = ' . $orderId
);
$this->ajaxDie('OK');
}
$this->ajaxDie('KO');
}
}

View File

@@ -0,0 +1,28 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (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;

View File

@@ -0,0 +1,52 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
use PrestaShop\Module\Ps_Googleanalytics\Repository\GanalyticsRepository;
class ps_GoogleanalyticsAjaxModuleFrontController extends ModuleFrontController
{
public $ssl = true;
/*
* @see FrontController::initContent()
*/
public function initContent()
{
parent::initContent();
$orderId = (int) Tools::getValue('orderid');
$order = new Order($orderId);
if (!Validate::isLoadedObject($order) || $order->id_customer != (int) Tools::getValue('customer')) {
$this->ajaxDie('KO');
}
(new GanalyticsRepository())->updateData(
[
'sent' => 1,
'date_add' => ['value' => 'NOW()', 'type' => 'sql'],
],
'id_order = ' . $orderId,
1
);
$this->ajaxDie('OK');
}
}

View File

@@ -0,0 +1,28 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (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;

View File

@@ -0,0 +1,28 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (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;

View File

@@ -0,0 +1,28 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (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;

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

@@ -0,0 +1,255 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
if (!defined('_PS_VERSION_')) {
exit;
}
$autoloadPath = __DIR__ . '/vendor/autoload.php';
if (file_exists($autoloadPath)) {
require_once $autoloadPath;
}
class Ps_Googleanalytics extends Module
{
/**
* @var string Name of the module running on PS 1.6.x. Used for data migration.
*/
const PS_16_EQUIVALENT_MODULE = 'ganalytics';
public $name;
public $tab;
public $version;
public $ps_versions_compliancy;
public $author;
public $module_key;
public $bootstrap;
public $displayName;
public $description;
public $confirmUninstall;
public $js_state = 0;
public $eligible = 0;
public $filterable = 1;
public $products = [];
public $_debug = 0;
public $psVersionIs17;
public function __construct()
{
$this->name = 'ps_googleanalytics';
$this->tab = 'analytics_stats';
$this->version = '4.1.2';
$this->ps_versions_compliancy = ['min' => '1.6', 'max' => _PS_VERSION_];
$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.');
$this->psVersionIs17 = (bool) version_compare(_PS_VERSION_, '1.7', '>=');
}
/**
* Back office module configuration page content
*/
public function getContent()
{
$configurationForm = new PrestaShop\Module\Ps_Googleanalytics\Form\ConfigurationForm($this);
$formOutput = '';
if (Tools::isSubmit('submit' . $this->name)) {
$formOutput = $configurationForm->treat();
}
$formOutput .= $configurationForm->generate();
return $this->display(__FILE__, './views/templates/admin/configuration.tpl') . $formOutput;
}
public function hookDisplayHeader($params, $back_office = false)
{
$hook = new PrestaShop\Module\Ps_Googleanalytics\Hooks\HookDisplayHeader($this, $this->context);
$hook->setBackOffice($back_office);
return $hook->run();
}
/**
* Confirmation page hook.
* This function is run to track transactions.
*/
public function hookDisplayOrderConfirmation($params)
{
$hook = new PrestaShop\Module\Ps_Googleanalytics\Hooks\HookDisplayOrderConfirmation($this, $this->context);
$hook->setParams($params);
return $hook->run();
}
/**
* Footer hook.
* This function is run to load JS script for standards actions such as product clicks
*/
public function hookDisplayFooter()
{
$hook = new PrestaShop\Module\Ps_Googleanalytics\Hooks\HookDisplayFooter($this, $this->context);
return $hook->run();
}
/**
* Homepage hook.
* This function is run to manage analytics for product list associated to home featured, news products and best sellers Modules
*/
public function hookDisplayHome()
{
$hook = new PrestaShop\Module\Ps_Googleanalytics\Hooks\HookDisplayHome($this, $this->context);
return $hook->run();
}
/**
* Product page footer hook
* This function is run to load JS for product details view
*/
public function hookDisplayFooterProduct($params)
{
$hook = new PrestaShop\Module\Ps_Googleanalytics\Hooks\HookDisplayFooterProduct($this, $this->context);
$hook->setParams($params);
return $hook->run();
}
/**
* Hook admin order.
* This function is run to send transactions and refunds details
*/
public function hookDisplayAdminOrder()
{
$gaTagHandler = new PrestaShop\Module\Ps_Googleanalytics\Handler\GanalyticsJsHandler($this, $this->context);
$output = $gaTagHandler->generate(
$this->context->cookie->__get('ga_admin_refund'),
true
);
$this->context->cookie->__unset('ga_admin_refund');
$this->context->cookie->write();
return $output;
}
/**
* Admin office header hook.
* This function is run to add Google Analytics JavaScript
*/
public function hookDisplayBackOfficeHeader()
{
$hook = new PrestaShop\Module\Ps_Googleanalytics\Hooks\HookDisplayBackOfficeHeader($this, $this->context);
return $hook->run();
}
/**
* Product cancel action hook (in Back office).
* This function is run to add Google Analytics JavaScript
*/
public function hookActionProductCancel($params)
{
$hook = new PrestaShop\Module\Ps_Googleanalytics\Hooks\HookActionProductCancel($this, $this->context);
$hook->setParams($params);
$hook->run();
}
/**
* Hook called after order status change, used to "refund" order after cancelling it
*/
public function hookActionOrderStatusPostUpdate($params)
{
$hook = new PrestaShop\Module\Ps_Googleanalytics\Hooks\HookActionOrderStatusPostUpdate($this, $this->context);
$hook->setParams($params);
$hook->run();
}
/**
* Save cart event hook.
* This function is run to implement 'add to cart' and 'remove from cart' functionalities
*/
public function hookActionCartSave()
{
$hook = new PrestaShop\Module\Ps_Googleanalytics\Hooks\HookActionCartSave($this, $this->context);
$hook->run();
}
public function hookActionCarrierProcess($params)
{
$hook = new PrestaShop\Module\Ps_Googleanalytics\Hooks\HookActionCarrierProcess($this, $this->context);
$hook->setParams($params);
$hook->run();
}
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);
}
/**
* This method is triggered at the installation of the module
* - it installs all module tables
* - it registers the hooks used by this module
*
* @return bool
*/
public function install()
{
$moduleHandler = new PrestaShop\Module\Ps_Googleanalytics\Handler\ModuleHandler();
$database = new PrestaShop\Module\Ps_Googleanalytics\Database\Install($this);
$moduleHandler->uninstallModule(self::PS_16_EQUIVALENT_MODULE);
return parent::install() &&
$database->registerHooks() &&
$database->setDefaultConfiguration() &&
$database->installTables();
}
/**
* Triggered at the uninstall of the module
* - erases this module SQL tables
*
* @return bool
*/
public function uninstall()
{
$database = new PrestaShop\Module\Ps_Googleanalytics\Database\Uninstall();
return parent::uninstall() &&
$database->uninstallTables();
}
}

View File

@@ -0,0 +1,34 @@
<?php
/**
* 2007-2020 PrestaShop SA and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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 https://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (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;

View File

@@ -0,0 +1,28 @@
#!/bin/bash
PS_VERSION=$1
set -e
# Docker images prestashop/prestashop may be used, even if the shop remains uninstalled
echo "Pull PrestaShop files (Tag ${PS_VERSION})"
docker rm -f temp-ps || true
docker volume rm -f ps-volume || true
docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:$PS_VERSION
# Clear previous instance of the module in the PrestaShop volume
echo "Clear previous module"
docker exec -t temp-ps rm -rf /var/www/html/modules/ps_googleanalytics
# Run a container for PHPStan, having access to the module content and PrestaShop sources.
# This tool is outside the composer.json because of the compatibility with PHP 5.6
echo "Run PHPStan using phpstan-${PS_VERSION}.neon file"
docker run --rm --volumes-from temp-ps \
-v $PWD:/var/www/html/modules/ps_googleanalytics \
-e _PS_ROOT_DIR_=/var/www/html \
--workdir=/var/www/html/modules/ps_googleanalytics phpstan/phpstan:0.12 \
analyse \
--configuration=/var/www/html/modules/ps_googleanalytics/tests/phpstan/phpstan-$PS_VERSION.neon

View File

@@ -0,0 +1,34 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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 https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/
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;

View File

@@ -0,0 +1,6 @@
includes:
- %currentWorkingDirectory%/tests/phpstan/phpstan.neon
parameters:
ignoreErrors:
- '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#'

View File

@@ -0,0 +1,6 @@
includes:
- %currentWorkingDirectory%/tests/phpstan/phpstan.neon
parameters:
ignoreErrors:
- '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#'

View File

@@ -0,0 +1,6 @@
includes:
- %currentWorkingDirectory%/tests/phpstan/phpstan.neon
parameters:
ignoreErrors:
- '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#'

View File

@@ -0,0 +1,6 @@
includes:
- %currentWorkingDirectory%/tests/phpstan/phpstan.neon
parameters:
ignoreErrors:
- '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#'

View File

@@ -0,0 +1,6 @@
includes:
- %currentWorkingDirectory%/tests/phpstan/phpstan.neon
parameters:
ignoreErrors:
- '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#'

View File

@@ -0,0 +1,6 @@
includes:
- %currentWorkingDirectory%/tests/phpstan/phpstan.neon
parameters:
ignoreErrors:
- '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#'

View File

@@ -0,0 +1,6 @@
includes:
- %currentWorkingDirectory%/tests/phpstan/phpstan.neon
parameters:
ignoreErrors:
- '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#'

View File

@@ -0,0 +1,6 @@
includes:
- %currentWorkingDirectory%/tests/phpstan/phpstan.neon
parameters:
ignoreErrors:
- '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#'

View File

@@ -0,0 +1,6 @@
includes:
- %currentWorkingDirectory%/tests/phpstan/phpstan.neon
parameters:
ignoreErrors:
- '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#'

View File

@@ -0,0 +1,14 @@
includes:
- %currentWorkingDirectory%/vendor/prestashop/php-dev-tools/phpstan/ps-module-extension.neon
parameters:
paths:
- ../../classes
- ../../controllers
- ../../ps_googleanalytics.php
reportUnmatchedIgnoredErrors: false
ignoreErrors:
- '#Strict comparison using === between false and Module will always evaluate to false.#'
- '#PrestaShop.Module.Ps_Googleanalytics.Handler.ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop.Module.Ps_Googleanalytics.Handler.ModuleHandler does not extend any class.#'
level: 5

View File

@@ -0,0 +1,15 @@
includes:
- %currentWorkingDirectory%/vendor/prestashop/php-dev-tools/phpstan/ps-module-extension.neon
parameters:
paths:
- ../../classes
- ../../controllers
- ../../ps_googleanalytics.php
reportUnmatchedIgnoredErrors: false
ignoreErrors:
- '#Property Ps_Googleanalytics::\$version \(float\) does not accept string.#'
- '#Strict comparison using === between false and Module will always evaluate to false.#'
- '#PrestaShop.Module.Ps_Googleanalytics.Handler.ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop.Module.Ps_Googleanalytics.Handler.ModuleHandler does not extend any class.#'
level: 5

View File

@@ -0,0 +1,6 @@
includes:
- %currentWorkingDirectory%/tests/phpstan/phpstan.neon
parameters:
ignoreErrors:
- '#PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler::uninstallModule\(\) calls parent::uninstall\(\) but PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler does not extend any class.#'

View File

@@ -0,0 +1,10 @@
includes:
- %currentWorkingDirectory%/vendor/prestashop/php-dev-tools/phpstan/ps-module-extension.neon
parameters:
paths:
# From PHPStan 0.12, paths to check are relative to the neon file
- ../../ps_googleanalytics.php
- ../../classes/
- ../../controllers/
- ../../upgrade/
level: 5

View File

@@ -0,0 +1,66 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
global $_MODULE;
$_MODULE = [];
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_7510f8b22dd3e10476096425f78d4239'] = 'Sie haben Ihre Google Analytics-ID noch nicht eingestellt';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_aba1a7971f85c725ba4aed21343eeb4b'] = 'Integrieren Sie das Google Analytics-Skript in Ihren Shop';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_fa214007826415a21a8456e3e09f999d'] = 'Sie sind sicher, dass Sie Ihre Daten löschen wollen?';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_d7c9ce3337a28d63ce6626d90fdaedaa'] = 'Ihr Benutzername';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_81eeab9506186e2dca8faefa78d54067'] = 'Beispiel:';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_a3e7f361e6fc12caf872119338642143'] = ' ID aktualisieren';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Hilfe';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_d78b0fcff6b55bafe615f3fc1572c282'] = 'Der erste Schritt zum Erfassen von E-Commerce-Transaktionen ist, E-Commerce-Berichte für das Profil Ihrer Website zu aktivieren.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_d02388589ecfd3b58e0a90e42127ca61'] = 'Bitte folgen Sie diesen Schritten, um die E-Commerce-Bereichte zu aktivieren:';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_11f4b4ba23dc72ee5e86ff5a90bdde60'] = 'Melden Sie sich bei Ihrem Konto an';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_b452493b16ead8b4b25ab3fb7174b8f5'] = 'Klicken Sie auf Bearbeiten neben dem Profil, das Sie aktivieren möchten';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_95df6d8c97e880d8f6895d824d72c353'] = 'Klicken Sie auf der Seite Profileinstellungen auf Bearbeiten neben der Hauptwebseiten-Profilinformation';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_5189c0be0481408c9301c377818e69dc'] = 'Drehen Sie den Radioknopf der E-Commerce-Webseite von Nein auf Ja';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_98d12a01ab2aeeb10b7100eecf1974a8'] = 'Geben Sie Ihre Ziel-Informationen ein, um Ihre Ziele einzustellen:';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_a44698a775d2fec04549ba6a2ac00491'] = 'Zurück zu Ihrer persönlichen Startseite';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_dbec126ee3be2cd285a32a8d413fd1fa'] = 'Suchen Sie das Profil, für das Sie ein Ziel erstellen möchten, klicken Sie dann auf Bearbeiten';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_c4af40d39b97cf98040540639841e27a'] = 'Wählen Sie eine der 4 verfügbaren Zielpositionen für dieses Profil und klicken dann auf \"Bearbeiten\"';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_c3b99aa9b4638183dc1bf55f955ed9ae'] = 'Geben Sie die Ziel-URL ein. Das Erreichen dieser Seite ist ein Zeichen für eine erfolgreiche Umwandlung';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_54849fd1a3b8bdde81bfd979bc43aaa9'] = 'Geben Sie den Zielnamen ein, wie er in Ihrem Google Analytics-Konto angezeigt werden soll';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_62034d209119c06315f59a5de39c6717'] = 'Aktivieren Sie das Ziel';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_792795e7f3cedd66897ca35349101ba8'] = 'Dann definieren Sie mit den folgenden Schritten einen Trichter:';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_467ed594f2aa9b3e802037a10bad61b1'] = 'Geben Sie die URL der ersten Seite Ihres Umwandlungstrichters ein. Dies sollte allen Nutzern vertraut sein, die auf Ihr Ziel zugehen.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_2edf3f56ba30ad663429ba0e812a2396'] = 'Geben Sie einen Namen für diesen Schritt ein.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_c909bea215f88ff0de9888dc95eed1ca'] = 'Wenn dieser Schritt erforderlich für die Umwandlung ist, klicken Sie das Kontrollkästchen rechts von diesem Schritt an.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_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['<{ps_googleanalytics}prestashop>ps_googleanalytics_1c681b64f4cd8f52aecbb55c98f5c768'] = 'Konfigurieren Sie abschließend die Zusätzlichen Einstellungen durch die folgenden Schritte unten:';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_bb1ca9cfa0f3f7dbd06a2364c9a0dc9c'] = 'Wenn die oben angegebenen URLs die Groß-/Kleinschreibung berücksichtigen, markieren Sie das Kontrollkästchen.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_047cf7562621a3639b3e04a63dc6b41f'] = 'Wählen Sie den entsprechenden Ziel-Übereinstimmungstyp. (';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_d59048f21fd887ad520398ce677be586'] = 'Erfahren Sie mehr';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_f0c5b61aabf16d5ce925722b65c9aad8'] = 'über Übereinstimmungstypen und wie den entsprechenden Ziel-Übereinstimmungstyp für Ihr Ziel wählen können.)';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_3dcb5dddc6b7c11d4ea76a60dc1a0466'] = 'Geben Sie einen Zielwert ein. Dies ist der Wert, der in den Google Analytics ROI-Berechnungen verwendet wird.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_a39f026ca75c6279ac9487265c00e3f5'] = 'Klicken Sie auf Änderungen speichern, um dieses Ziel und diesen Trichter zu erstellen , oder Abbrechen, um ohne Speichern zu beenden.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_cd4952b65560a1242c68ffc980a6e515'] = 'Demonstration: Der Bestellvorgang';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_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['<{ps_googleanalytics}prestashop>ps_googleanalytics_68db264effa9364901183d9d12fac500'] = 'Dieses Ziel benennen (zum Beispiel \'Bestellvorgang\')';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_9b8bc3519c65da8fac122f91ac5b7673'] = 'Aktivieren Sie das Ziel';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_86a358dd6df1ba0cb3565b88380ba7a6'] = 'Fügen Sie \'product.php\' als erste Seite Ihres Umwandlungstrichters hinzu';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_b7f896191caad09b5fc34e79f1cefa76'] = 'Benennen Sie sie (zum Beispiel \'Produktseite\')';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_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['<{ps_googleanalytics}prestashop>ps_googleanalytics_3bab28a0105361c49ca261ca08a19bf7'] = 'Fahren Sie fort, indem Sie die folgenden URLs als Zielschritte eingeben:';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_9bfb6e6af6e6793bfa9387e728187c87'] = '(Erforderlich)';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_6a47891ae07f45802bc948d2618e36f5'] = 'Überprüfen Sie die \'Groß-/Kleinschreibung\'-Option';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_d2d0c38d112e1d775057388122ae7545'] = 'Speichern Sie dieses neue Ziel';

View File

@@ -0,0 +1,70 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
global $_MODULE;
$_MODULE = [];
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_7510f8b22dd3e10476096425f78d4239'] = 'You have not yet set your Google Analytics ID';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_aba1a7971f85c725ba4aed21343eeb4b'] = 'Integrate Google Analytics script into your shop';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_fa214007826415a21a8456e3e09f999d'] = 'Are you sure you want to delete your details ?';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_c888438d14855d7d96a2724ee9c306bd'] = 'Settings updated';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_f4f70727dc34561dfde1a3c529b6205c'] = 'Settings';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_d7c9ce3337a28d63ce6626d90fdaedaa'] = 'Your username';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_81eeab9506186e2dca8faefa78d54067'] = 'Example:';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_b2e71617778d8acc54945b2e7cd5b16e'] = 'Universal Analytics Active';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_a3e7f361e6fc12caf872119338642143'] = 'Update ID';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Help';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_d78b0fcff6b55bafe615f3fc1572c282'] = 'The first step of tracking e-commerce transactions is to enable e-commerce reporting for your website\'s profile.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_d02388589ecfd3b58e0a90e42127ca61'] = 'To enable e-Commerce reporting, please follow these steps:';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_11f4b4ba23dc72ee5e86ff5a90bdde60'] = 'Log in to your account';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_b452493b16ead8b4b25ab3fb7174b8f5'] = 'Click Edit next to the profile you would like to enable.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_95df6d8c97e880d8f6895d824d72c353'] = 'On the Profile Settings page, click Edit (next to Main Website Profile Information).';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_5189c0be0481408c9301c377818e69dc'] = 'Change the e-Commerce Website radio button from No to Yes';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_98d12a01ab2aeeb10b7100eecf1974a8'] = 'To set up your goals, enter Goal Information:';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_a44698a775d2fec04549ba6a2ac00491'] = 'Return to Your Account main page';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_dbec126ee3be2cd285a32a8d413fd1fa'] = 'Find the profile for which you will be creating goals, then click Edit';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_c4af40d39b97cf98040540639841e27a'] = 'Select one of the 4 goal slots available for that profile, then click Edit';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_c3b99aa9b4638183dc1bf55f955ed9ae'] = 'Enter the Goal URL. Reaching this page marks a successful conversion.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_54849fd1a3b8bdde81bfd979bc43aaa9'] = 'Enter the Goal name as it should appear in your Google Analytics account.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_62034d209119c06315f59a5de39c6717'] = 'Turn on Goal.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_792795e7f3cedd66897ca35349101ba8'] = 'Then, define a funnel by following these steps:';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_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['<{ps_googleanalytics}prestashop>ps_googleanalytics_2edf3f56ba30ad663429ba0e812a2396'] = 'Enter a Name for this step.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_c909bea215f88ff0de9888dc95eed1ca'] = 'If this step is a required step in the conversion process, mark the checkbox to the right of the step.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_9d25cb4b66791343ca319b3cdb82dba6'] = 'Continue entering goal steps until your funnel has been completely defined. You may enter up to 10 steps, or only one step.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_1c681b64f4cd8f52aecbb55c98f5c768'] = 'Finally, configure Additional settings by following the steps below:';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_bb1ca9cfa0f3f7dbd06a2364c9a0dc9c'] = 'If the URLs entered above are case sensitive, mark the checkbox.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_047cf7562621a3639b3e04a63dc6b41f'] = 'Select the appropriate goal Match Type. (';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_d59048f21fd887ad520398ce677be586'] = 'Learn more';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_f0c5b61aabf16d5ce925722b65c9aad8'] = 'about Match Types and how to choose the appropriate goal Match Type for your goal.)';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_3dcb5dddc6b7c11d4ea76a60dc1a0466'] = 'Enter a Goal value. This is the value used in Google Analytics\' ROI calculations.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_a39f026ca75c6279ac9487265c00e3f5'] = 'Click Save Changes to create this Goal and funnel, or Cancel to exit without saving.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_cd4952b65560a1242c68ffc980a6e515'] = 'Demonstration: The order process';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_efbf206b1b60cc0400c6147723509bd6'] = 'After having enabled your e-commerce reports and selected the respective profile enter \'order-confirmation.php\' as the targeted page URL.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_68db264effa9364901183d9d12fac500'] = 'Name this goal (for example \'Order process\')';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_9b8bc3519c65da8fac122f91ac5b7673'] = 'Activate the goal';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_86a358dd6df1ba0cb3565b88380ba7a6'] = 'Add \'product.php\' as the first page of your conversion funnel';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_b7f896191caad09b5fc34e79f1cefa76'] = 'Give it a name (for example, \'Product page\')';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_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['<{ps_googleanalytics}prestashop>ps_googleanalytics_3bab28a0105361c49ca261ca08a19bf7'] = 'Continue by entering the following URLs as goal steps:';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_9bfb6e6af6e6793bfa9387e728187c87'] = '(required)';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_6a47891ae07f45802bc948d2618e36f5'] = 'Check the \'Case sensitive\' option';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_d2d0c38d112e1d775057388122ae7545'] = 'Save this new goal';
return $_MODULE;

View File

@@ -0,0 +1,66 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
global $_MODULE;
$_MODULE = [];
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_7510f8b22dd3e10476096425f78d4239'] = 'Aún no ha configurado su ID de Google Analytics';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_aba1a7971f85c725ba4aed21343eeb4b'] = 'Integrar el script de Google Analytics en su tienda';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_fa214007826415a21a8456e3e09f999d'] = '¿Está seguro de querer eliminar todos sus datos?';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_c888438d14855d7d96a2724ee9c306bd'] = 'Configuración actualizada';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuración';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_d7c9ce3337a28d63ce6626d90fdaedaa'] = 'Su nombre de usuario';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_81eeab9506186e2dca8faefa78d54067'] = 'Ejemplo:';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_a3e7f361e6fc12caf872119338642143'] = 'Actualizar ID';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Ayuda';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_d78b0fcff6b55bafe615f3fc1572c282'] = 'El primer paso para seguir las transacciones de comercio electrónico es activar el informe de su tienda en su perfil.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_d02388589ecfd3b58e0a90e42127ca61'] = 'Para activar el informe de comercio electrónico, por favor revise estos pasos:';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_11f4b4ba23dc72ee5e86ff5a90bdde60'] = 'Entrar en su cuenta';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_b452493b16ead8b4b25ab3fb7174b8f5'] = 'Haga clic en Editar en el perfil que quiere activar';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_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['<{ps_googleanalytics}prestashop>ps_googleanalytics_5189c0be0481408c9301c377818e69dc'] = 'seleccione sí/no en Web de comercio electrónico';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_98d12a01ab2aeeb10b7100eecf1974a8'] = 'Para configurar sus objetivos, introduzca información sobre ellos:';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_a44698a775d2fec04549ba6a2ac00491'] = 'Volver a la página principal de su cuenta';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_dbec126ee3be2cd285a32a8d413fd1fa'] = 'Encuentra el perfil del objetivo que quieres crear, y pulsa \\\"Editar\\\"';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_c4af40d39b97cf98040540639841e27a'] = 'Seleccione uno de los cuatro objetivos disponibles para su perfil, después haga clic en Edit';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_c3b99aa9b4638183dc1bf55f955ed9ae'] = 'Introduzca la URL objetivo. Acceder a esta página generará una conversión correcta';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_54849fd1a3b8bdde81bfd979bc43aaa9'] = 'Introduzca el nombre del objetivo tal como aparece en su cuenta Google Analytics';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_62034d209119c06315f59a5de39c6717'] = 'Activar el objetivo';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_792795e7f3cedd66897ca35349101ba8'] = 'Después, defina un redireccionamiento siguiendo estos pasos:';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_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['<{ps_googleanalytics}prestashop>ps_googleanalytics_2edf3f56ba30ad663429ba0e812a2396'] = 'Introduzca un nombre para este paso';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_c909bea215f88ff0de9888dc95eed1ca'] = 'Si este paso es necesario en el proceso de conversión, seleccione la casilla de la derecha del paso.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_9d25cb4b66791343ca319b3cdb82dba6'] = 'Continue avanzando hasta completar el objetivo. Debe introducir de 1 a 10 etapas.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_1c681b64f4cd8f52aecbb55c98f5c768'] = 'Para terminar, configure los parámetros complementarios para continuar los siguientes pasos: ';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_bb1ca9cfa0f3f7dbd06a2364c9a0dc9c'] = 'Si las URLs introducidas arriba distinguen entre mayúsculas y minúsculas, marque la casilla de verificación.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_047cf7562621a3639b3e04a63dc6b41f'] = 'Seleccione el objetivo apropiado. (';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_d59048f21fd887ad520398ce677be586'] = 'Más información';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_f0c5b61aabf16d5ce925722b65c9aad8'] = 'sobre los Tipos de Partidos y sobre la manera de elegir el tipo de correspondencia adecuada a su objetivo.)';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_3dcb5dddc6b7c11d4ea76a60dc1a0466'] = 'Introduzca un valor objetivo. Este es el valor utilizado para los cáculos de Google Analitics.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_a39f026ca75c6279ac9487265c00e3f5'] = 'Haga clic en \\\"Salvar cambios\\\" para crear este objetivo, o cancelar para salir sin guardar cambios.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_cd4952b65560a1242c68ffc980a6e515'] = 'Demostración: El proceso de pedido';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_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['<{ps_googleanalytics}prestashop>ps_googleanalytics_68db264effa9364901183d9d12fac500'] = 'Nombre del objetivo (por ejemplo \\\"proceso del pedido\\\")';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_9b8bc3519c65da8fac122f91ac5b7673'] = 'Activar el objetivo';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_86a358dd6df1ba0cb3565b88380ba7a6'] = 'Añadir \'producto.php\' como la primera página de redireccionamiento';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_b7f896191caad09b5fc34e79f1cefa76'] = 'Dele un nombre (por ejemplo \\\"Página del producto\\\")';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_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['<{ps_googleanalytics}prestashop>ps_googleanalytics_3bab28a0105361c49ca261ca08a19bf7'] = 'Continúe introduciendo las siguientes URL como objetivos:';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_9bfb6e6af6e6793bfa9387e728187c87'] = '(obligatorio)';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_6a47891ae07f45802bc948d2618e36f5'] = 'Revise la opción de \\\"distinción mayúsculas-minúsculas\\\"';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_d2d0c38d112e1d775057388122ae7545'] = 'Guardar este nuevo objetivo';

View File

@@ -0,0 +1,66 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
global $_MODULE;
$_MODULE = [];
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_7510f8b22dd3e10476096425f78d4239'] = 'Vous n\'avez pas encore renseigné votre ID Google Analytics';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_aba1a7971f85c725ba4aed21343eeb4b'] = 'Intègre le script de Google Analytics à votre boutique';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_fa214007826415a21a8456e3e09f999d'] = 'Etes-vous sûr de vouloir supprimer vos paramètres ?';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres mis à jour';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_d7c9ce3337a28d63ce6626d90fdaedaa'] = 'Votre identifiant';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_81eeab9506186e2dca8faefa78d54067'] = 'Exemple :';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_a3e7f361e6fc12caf872119338642143'] = 'Enregistrer l\'identifiant';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Aide';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_d78b0fcff6b55bafe615f3fc1572c282'] = 'La première étape pour analyser les transactions e-commerce consiste à activer l\'archivage sur le profil de votre site.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_d02388589ecfd3b58e0a90e42127ca61'] = 'Pour activer l\'option e-commerce, suivez ces étapes :';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_11f4b4ba23dc72ee5e86ff5a90bdde60'] = 'Connectez-vous à votre compte';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_b452493b16ead8b4b25ab3fb7174b8f5'] = 'Cliquez sur Edit, à côté du profil que vous désirez activer';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_95df6d8c97e880d8f6895d824d72c353'] = 'Sur la page \"Paramètres des profils\", cliquez sur \"Modifier\" en regard de l\'option \"Informations sur le profil du site principal\"';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_5189c0be0481408c9301c377818e69dc'] = 'Modifiez le bouton radio \"E-commerce\" sur \"Oui\"';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_98d12a01ab2aeeb10b7100eecf1974a8'] = 'Afin de définir vos objectifs, saisissez les informations de l\'objectif :';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_a44698a775d2fec04549ba6a2ac00491'] = 'Retournez sur la page d\'accueil de votre compte';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_dbec126ee3be2cd285a32a8d413fd1fa'] = 'Trouvez le profil correspondant à l\'objectif et éditez-le';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_c4af40d39b97cf98040540639841e27a'] = 'Sélectionnez un des 4 emplacements disponibles pour ce profil et cliquez sur Editer';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_c3b99aa9b4638183dc1bf55f955ed9ae'] = 'Entrez l\'URL de la page d\'objectif. Une conversion est enregistrée chaque fois qu\'un visiteur accède à cette page';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_54849fd1a3b8bdde81bfd979bc43aaa9'] = 'Entrez le nom de l\'objectif tel qu\'il doit apparaître dans votre compte Google Analytics.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_62034d209119c06315f59a5de39c6717'] = 'Activez l\'objectif';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_792795e7f3cedd66897ca35349101ba8'] = 'Ensuite, définissez un entonnoir de conversion en suivant ces étapes :';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_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['<{ps_googleanalytics}prestashop>ps_googleanalytics_2edf3f56ba30ad663429ba0e812a2396'] = 'Attribuez un nom à cette étape.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_c909bea215f88ff0de9888dc95eed1ca'] = 'Si cette étape est obligatoire dans l\'objectif, cochez la case à droite de cette étape.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_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['<{ps_googleanalytics}prestashop>ps_googleanalytics_1c681b64f4cd8f52aecbb55c98f5c768'] = 'Pour finir, configurez les Paramètres complémentaires en procédant comme suit :';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_bb1ca9cfa0f3f7dbd06a2364c9a0dc9c'] = 'Si les URL entrées ci-dessus sont sensibles à la casse, cochez la case.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_047cf7562621a3639b3e04a63dc6b41f'] = 'Sélectionnez l\'objectif approprié. (';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_d59048f21fd887ad520398ce677be586'] = 'En savoir plus';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_f0c5b61aabf16d5ce925722b65c9aad8'] = 'sur les types de correspondances et sur la façon de choisir le type de correspondance approprié à votre objectif)';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_3dcb5dddc6b7c11d4ea76a60dc1a0466'] = 'Entrez un objectif. Cette valeur est utilisée par les calculs ROI de Google Analytics.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_a39f026ca75c6279ac9487265c00e3f5'] = 'Cliquez sur Enregistrer les modifications pour créer cet objectif et cet entonnoir de conversion ou sur Annuler pour quitter sans enregistrer.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_cd4952b65560a1242c68ffc980a6e515'] = 'Démonstration : Le processus de commande';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_efbf206b1b60cc0400c6147723509bd6'] = 'Après avoir activé vos reports e-commerce et sélectionné les profils respectifs, entrez \'order-confirmation.php\' comme page cible.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_68db264effa9364901183d9d12fac500'] = 'Nommez cet objectif (par exemple \'Processus de commande\')';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_9b8bc3519c65da8fac122f91ac5b7673'] = 'Activez l\'objectif';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_86a358dd6df1ba0cb3565b88380ba7a6'] = 'Ajoutez \'product.php\' comme la première page du cheminement de vos visiteurs';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_b7f896191caad09b5fc34e79f1cefa76'] = 'Donnez lui un nom (par exemple \'Page produit\')';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_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['<{ps_googleanalytics}prestashop>ps_googleanalytics_3bab28a0105361c49ca261ca08a19bf7'] = 'Faites de même en entrant les urls suivantes comme étapes de l\'objectif';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_9bfb6e6af6e6793bfa9387e728187c87'] = 'requis';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_6a47891ae07f45802bc948d2618e36f5'] = 'Vérifiez l\'option \'sensibilité de la casse\'';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_d2d0c38d112e1d775057388122ae7545'] = 'Sauvegardez cet objectif';

View File

@@ -0,0 +1,28 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (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;

View File

@@ -0,0 +1,66 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
global $_MODULE;
$_MODULE = [];
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_7510f8b22dd3e10476096425f78d4239'] = 'Non hai ancora impostato l\'ID di Google Analytics';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_aba1a7971f85c725ba4aed21343eeb4b'] = 'Integra lo script di Google Analytics nel tuo negozio';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_fa214007826415a21a8456e3e09f999d'] = 'Sei sicuro di voler cancellare i tuoi dati?';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_d7c9ce3337a28d63ce6626d90fdaedaa'] = 'Il tuo nome utente';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_81eeab9506186e2dca8faefa78d54067'] = 'Esempio:';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_a3e7f361e6fc12caf872119338642143'] = 'Aggiorna ID';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_6a26f548831e6a8c26bfbbd9f6ec61e0'] = 'Aiuto';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_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['<{ps_googleanalytics}prestashop>ps_googleanalytics_d02388589ecfd3b58e0a90e42127ca61'] = 'Per attivare il rapporto dell\'e-commerce, segui queste fasi:';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_11f4b4ba23dc72ee5e86ff5a90bdde60'] = 'Accedi al tuo account';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_b452493b16ead8b4b25ab3fb7174b8f5'] = 'Clicca su Modifica accanto al profilo che desideri attivare';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_95df6d8c97e880d8f6895d824d72c353'] = 'Nella pagina Impostazioni profilo, fai clic su modifica accanto alle informazioni profilo sito web principale';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_5189c0be0481408c9301c377818e69dc'] = 'Modifica il tasto radio del sito e-commerce da No a Sì.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_98d12a01ab2aeeb10b7100eecf1974a8'] = 'Per impostare gli obiettivi, inserisci i dati dell\'obiettivo:';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_a44698a775d2fec04549ba6a2ac00491'] = 'Ritorna alla pagina principale dell\'account ';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_dbec126ee3be2cd285a32a8d413fd1fa'] = 'Individua il profilo per il quale desideri creare gli obiettivi, quindi clicca su Modifica';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_c4af40d39b97cf98040540639841e27a'] = 'Selezionare uno dei 4 spazi adibiti agli obiettivi disponibili per il profilo, quindi clicca su Modifica';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_c3b99aa9b4638183dc1bf55f955ed9ae'] = 'Inserire l\'URL dell\'obiettivo. Il raggiungimento di questa pagina segna una conversione riuscita';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_54849fd1a3b8bdde81bfd979bc43aaa9'] = 'Inserisci il nome dell\'obiettivo come dovrebbe apparire nel tuo account Google Analytics';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_62034d209119c06315f59a5de39c6717'] = 'Attiva l\'obiettivo';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_792795e7f3cedd66897ca35349101ba8'] = 'Quindi, definire un imbuto nel seguente modo:';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_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['<{ps_googleanalytics}prestashop>ps_googleanalytics_2edf3f56ba30ad663429ba0e812a2396'] = 'Inserisci un nome per questa fase.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_c909bea215f88ff0de9888dc95eed1ca'] = 'Se questa fase è un passaggio obbligatorio nella procedura di conversione, seleziona la casella a destra del passaggio.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_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['<{ps_googleanalytics}prestashop>ps_googleanalytics_1c681b64f4cd8f52aecbb55c98f5c768'] = 'Infine, configura le Impostazioni aggiuntive procedendo nel seguente modo:';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_bb1ca9cfa0f3f7dbd06a2364c9a0dc9c'] = 'Se gli URL inseriti sopra sono case sensitive, segna la casella di controllo.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_047cf7562621a3639b3e04a63dc6b41f'] = 'Seleziona l\'obiettivo appropriato. (';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_d59048f21fd887ad520398ce677be586'] = 'Per saperne di più';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_f0c5b61aabf16d5ce925722b65c9aad8'] = 'sui tipi di corrispondenze e su come scegliere il tipo di corrispondenza per il tuo obiettivo.)';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_3dcb5dddc6b7c11d4ea76a60dc1a0466'] = 'Inserire un valore obiettivo. Questo è il valore utilizzato nei calcoli ROI di Google Analytics.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_a39f026ca75c6279ac9487265c00e3f5'] = 'Fai clic su Salva modifiche per creare l\'obiettivo e la canalizzazione o su Annulla per uscire senza salvare.';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_cd4952b65560a1242c68ffc980a6e515'] = 'Dimostrazione: Il processo di ordinazione';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_efbf206b1b60cc0400c6147723509bd6'] = 'Dopo aver attivato i rapporti e-commerce e selezionato il profilo inserire \'order-confirmation.php\' come pagina obiettivo';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_68db264effa9364901183d9d12fac500'] = 'Nome di questo obiettivo (per esempio \'elaborazione ordine\')';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_9b8bc3519c65da8fac122f91ac5b7673'] = 'Attiva l\'obiettivo';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_86a358dd6df1ba0cb3565b88380ba7a6'] = 'Aggiungi \'Product.php\' come prima pagina della tua conversione ';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_b7f896191caad09b5fc34e79f1cefa76'] = 'Dagli un nome (ad esempio, \'pagina del prodotto\')';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_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['<{ps_googleanalytics}prestashop>ps_googleanalytics_3bab28a0105361c49ca261ca08a19bf7'] = 'Proseguire inserendo i seguenti URL come fasi:';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_9bfb6e6af6e6793bfa9387e728187c87'] = '(Obbligatorio)';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_6a47891ae07f45802bc948d2618e36f5'] = 'Spuntare l\'opIone \'case sensitive\' ';
$_MODULE['<{ps_googleanalytics}prestashop>ps_googleanalytics_d2d0c38d112e1d775057388122ae7545'] = 'Salva questo nuovo obiettivo';

View File

@@ -0,0 +1,28 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (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;

View File

@@ -0,0 +1,34 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_3_1_0($object)
{
Configuration::updateValue('GANALYTICS', '3.1.0');
return Db::getInstance()->execute('
CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'ganalytics_data` (
`id_cart` int(11) NOT NULL,
`id_shop` int(11) NOT NULL,
`data` TEXT DEFAULT NULL,
PRIMARY KEY (`id_cart`)
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8');
}

View File

@@ -0,0 +1,39 @@
<?php
/**
* 2007-2020 PrestaShop.
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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 <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_4_1_0($object)
{
if (!$object->registerHook('actionOrderStatusPostUpdate')) {
return false;
}
Configuration::updateValue('GA_CANCELLED_STATES', json_encode([Configuration::get('PS_OS_CANCELED')]));
return Db::getInstance()->execute('ALTER TABLE `' . _DB_PREFIX_ . 'ganalytics` ADD `refund_sent` tinyint(1) NULL AFTER `sent`;');
}

View File

@@ -0,0 +1,10 @@
# Apache 2.2
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
# Apache 2.4
<IfModule mod_authz_core.c>
Require all denied
</IfModule>

View File

@@ -0,0 +1,7 @@
<?php
// autoload.php @generated by Composer
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit162ecf782ecf746701d3f22c639569e9::getLoader();

View File

@@ -0,0 +1,445 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Autoload;
/**
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
*
* $loader = new \Composer\Autoload\ClassLoader();
*
* // register classes with namespaces
* $loader->add('Symfony\Component', __DIR__.'/component');
* $loader->add('Symfony', __DIR__.'/framework');
*
* // activate the autoloader
* $loader->register();
*
* // to enable searching the include path (eg. for PEAR packages)
* $loader->setUseIncludePath(true);
*
* In this example, if you try to use a class in the Symfony\Component
* namespace or one of its children (Symfony\Component\Console for instance),
* the autoloader will first look for the class under the component/
* directory, and it will then fallback to the framework/ directory if not
* found before giving up.
*
* This class is loosely based on the Symfony UniversalClassLoader.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Jordi Boggiano <j.boggiano@seld.be>
* @see http://www.php-fig.org/psr/psr-0/
* @see http://www.php-fig.org/psr/psr-4/
*/
class ClassLoader
{
// PSR-4
private $prefixLengthsPsr4 = array();
private $prefixDirsPsr4 = array();
private $fallbackDirsPsr4 = array();
// PSR-0
private $prefixesPsr0 = array();
private $fallbackDirsPsr0 = array();
private $useIncludePath = false;
private $classMap = array();
private $classMapAuthoritative = false;
private $missingClasses = array();
private $apcuPrefix;
public function getPrefixes()
{
if (!empty($this->prefixesPsr0)) {
return call_user_func_array('array_merge', $this->prefixesPsr0);
}
return array();
}
public function getPrefixesPsr4()
{
return $this->prefixDirsPsr4;
}
public function getFallbackDirs()
{
return $this->fallbackDirsPsr0;
}
public function getFallbackDirsPsr4()
{
return $this->fallbackDirsPsr4;
}
public function getClassMap()
{
return $this->classMap;
}
/**
* @param array $classMap Class to filename map
*/
public function addClassMap(array $classMap)
{
if ($this->classMap) {
$this->classMap = array_merge($this->classMap, $classMap);
} else {
$this->classMap = $classMap;
}
}
/**
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
* @param string $prefix The prefix
* @param array|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
*/
public function add($prefix, $paths, $prepend = false)
{
if (!$prefix) {
if ($prepend) {
$this->fallbackDirsPsr0 = array_merge(
(array) $paths,
$this->fallbackDirsPsr0
);
} else {
$this->fallbackDirsPsr0 = array_merge(
$this->fallbackDirsPsr0,
(array) $paths
);
}
return;
}
$first = $prefix[0];
if (!isset($this->prefixesPsr0[$first][$prefix])) {
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
return;
}
if ($prepend) {
$this->prefixesPsr0[$first][$prefix] = array_merge(
(array) $paths,
$this->prefixesPsr0[$first][$prefix]
);
} else {
$this->prefixesPsr0[$first][$prefix] = array_merge(
$this->prefixesPsr0[$first][$prefix],
(array) $paths
);
}
}
/**
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
if (!$prefix) {
// Register directories for the root namespace.
if ($prepend) {
$this->fallbackDirsPsr4 = array_merge(
(array) $paths,
$this->fallbackDirsPsr4
);
} else {
$this->fallbackDirsPsr4 = array_merge(
$this->fallbackDirsPsr4,
(array) $paths
);
}
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
// Register directories for a new namespace.
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
} elseif ($prepend) {
// Prepend directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
(array) $paths,
$this->prefixDirsPsr4[$prefix]
);
} else {
// Append directories for an already registered namespace.
$this->prefixDirsPsr4[$prefix] = array_merge(
$this->prefixDirsPsr4[$prefix],
(array) $paths
);
}
}
/**
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
* @param string $prefix The prefix
* @param array|string $paths The PSR-0 base directories
*/
public function set($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr0 = (array) $paths;
} else {
$this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
}
}
/**
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*/
public function setPsr4($prefix, $paths)
{
if (!$prefix) {
$this->fallbackDirsPsr4 = (array) $paths;
} else {
$length = strlen($prefix);
if ('\\' !== $prefix[$length - 1]) {
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
}
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
$this->prefixDirsPsr4[$prefix] = (array) $paths;
}
}
/**
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
*/
public function setUseIncludePath($useIncludePath)
{
$this->useIncludePath = $useIncludePath;
}
/**
* Can be used to check if the autoloader uses the include path to check
* for classes.
*
* @return bool
*/
public function getUseIncludePath()
{
return $this->useIncludePath;
}
/**
* Turns off searching the prefix and fallback directories for classes
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
*/
public function setClassMapAuthoritative($classMapAuthoritative)
{
$this->classMapAuthoritative = $classMapAuthoritative;
}
/**
* Should class lookup fail if not found in the current class map?
*
* @return bool
*/
public function isClassMapAuthoritative()
{
return $this->classMapAuthoritative;
}
/**
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
*
* @param string|null $apcuPrefix
*/
public function setApcuPrefix($apcuPrefix)
{
$this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
}
/**
* The APCu prefix in use, or null if APCu caching is not enabled.
*
* @return string|null
*/
public function getApcuPrefix()
{
return $this->apcuPrefix;
}
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
*/
public function register($prepend = false)
{
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
}
/**
* Unregisters this instance as an autoloader.
*/
public function unregister()
{
spl_autoload_unregister(array($this, 'loadClass'));
}
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
* @return bool|null True if loaded, null otherwise
*/
public function loadClass($class)
{
if ($file = $this->findFile($class)) {
includeFile($file);
return true;
}
}
/**
* Finds the path to the file where the class is defined.
*
* @param string $class The name of the class
*
* @return string|false The path if found, false otherwise
*/
public function findFile($class)
{
// class map lookup
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
return false;
}
if (null !== $this->apcuPrefix) {
$file = apcu_fetch($this->apcuPrefix.$class, $hit);
if ($hit) {
return $file;
}
}
$file = $this->findFileWithExtension($class, '.php');
// Search for Hack files if we are running on HHVM
if (false === $file && defined('HHVM_VERSION')) {
$file = $this->findFileWithExtension($class, '.hh');
}
if (null !== $this->apcuPrefix) {
apcu_add($this->apcuPrefix.$class, $file);
}
if (false === $file) {
// Remember that this class does not exist.
$this->missingClasses[$class] = true;
}
return $file;
}
private function findFileWithExtension($class, $ext)
{
// PSR-4 lookup
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
$first = $class[0];
if (isset($this->prefixLengthsPsr4[$first])) {
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
$search = $subPath.'\\';
if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {
if (file_exists($file = $dir . $pathEnd)) {
return $file;
}
}
}
}
}
// PSR-4 fallback dirs
foreach ($this->fallbackDirsPsr4 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
return $file;
}
}
// PSR-0 lookup
if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name
$logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
. strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
} else {
// PEAR-like class name
$logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
}
if (isset($this->prefixesPsr0[$first])) {
foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
if (0 === strpos($class, $prefix)) {
foreach ($dirs as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
}
}
}
// PSR-0 fallback dirs
foreach ($this->fallbackDirsPsr0 as $dir) {
if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
return $file;
}
}
// PSR-0 include paths.
if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
return $file;
}
return false;
}
}
/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*/
function includeFile($file)
{
include $file;
}

View File

@@ -0,0 +1,21 @@
Copyright (c) Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -0,0 +1,36 @@
<?php
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'AdminGanalyticsAjaxController' => $baseDir . '/controllers/admin/AdminGanalyticsAjax.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Database\\Install' => $baseDir . '/classes/Database/Install.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Database\\Uninstall' => $baseDir . '/classes/Database/Uninstall.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Form\\ConfigurationForm' => $baseDir . '/classes/Form/ConfigurationForm.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\GoogleAnalyticsTools' => $baseDir . '/classes/GoogleAnalyticsTools.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\GanalyticsDataHandler' => $baseDir . '/classes/Handler/GanalyticsDataHandler.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\GanalyticsJsHandler' => $baseDir . '/classes/Handler/GanalyticsJsHandler.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler' => $baseDir . '/classes/Handler/ModuleHandler.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionCarrierProcess' => $baseDir . '/classes/Hook/HookActionCarrierProcess.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionCartSave' => $baseDir . '/classes/Hook/HookActionCartSave.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionOrderStatusPostUpdate' => $baseDir . '/classes/Hook/HookActionOrderStatusPostUpdate.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionProductCancel' => $baseDir . '/classes/Hook/HookActionProductCancel.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayBackOfficeHeader' => $baseDir . '/classes/Hook/HookDisplayBackOfficeHeader.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayFooter' => $baseDir . '/classes/Hook/HookDisplayFooter.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayFooterProduct' => $baseDir . '/classes/Hook/HookDisplayFooterProduct.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayHeader' => $baseDir . '/classes/Hook/HookDisplayHeader.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayHome' => $baseDir . '/classes/Hook/HookDisplayHome.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayOrderConfirmation' => $baseDir . '/classes/Hook/HookDisplayOrderConfirmation.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookInterface' => $baseDir . '/classes/Hook/HookInterface.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\WrapperInterface' => $baseDir . '/classes/Wrapper/WrapperInterface.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Repository\\CarrierRepository' => $baseDir . '/classes/Repository/CarrierRepository.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Repository\\GanalyticsDataRepository' => $baseDir . '/classes/Repository/GanalyticsDataRepository.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Repository\\GanalyticsRepository' => $baseDir . '/classes/Repository/GanalyticsRepository.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Wrapper\\OrderWrapper' => $baseDir . '/classes/Wrapper/OrderWrapper.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Wrapper\\ProductWrapper' => $baseDir . '/classes/Wrapper/ProductWrapper.php',
'Ps_Googleanalytics' => $baseDir . '/ps_googleanalytics.php',
'ps_GoogleanalyticsAjaxModuleFrontController' => $baseDir . '/controllers/front/ajax.php',
);

View File

@@ -0,0 +1,9 @@
<?php
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);

View File

@@ -0,0 +1,9 @@
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);

View File

@@ -0,0 +1,43 @@
<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit162ecf782ecf746701d3f22c639569e9
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit162ecf782ecf746701d3f22c639569e9', 'loadClassLoader'), true, false);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit162ecf782ecf746701d3f22c639569e9', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit162ecf782ecf746701d3f22c639569e9::getInitializer($loader));
} else {
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
}
$loader->setClassMapAuthoritative(true);
$loader->register(false);
return $loader;
}
}

View File

@@ -0,0 +1,46 @@
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInit162ecf782ecf746701d3f22c639569e9
{
public static $classMap = array (
'AdminGanalyticsAjaxController' => __DIR__ . '/../..' . '/controllers/admin/AdminGanalyticsAjax.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Database\\Install' => __DIR__ . '/../..' . '/classes/Database/Install.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Database\\Uninstall' => __DIR__ . '/../..' . '/classes/Database/Uninstall.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Form\\ConfigurationForm' => __DIR__ . '/../..' . '/classes/Form/ConfigurationForm.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\GoogleAnalyticsTools' => __DIR__ . '/../..' . '/classes/GoogleAnalyticsTools.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\GanalyticsDataHandler' => __DIR__ . '/../..' . '/classes/Handler/GanalyticsDataHandler.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\GanalyticsJsHandler' => __DIR__ . '/../..' . '/classes/Handler/GanalyticsJsHandler.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Handler\\ModuleHandler' => __DIR__ . '/../..' . '/classes/Handler/ModuleHandler.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionCarrierProcess' => __DIR__ . '/../..' . '/classes/Hook/HookActionCarrierProcess.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionCartSave' => __DIR__ . '/../..' . '/classes/Hook/HookActionCartSave.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionOrderStatusPostUpdate' => __DIR__ . '/../..' . '/classes/Hook/HookActionOrderStatusPostUpdate.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookActionProductCancel' => __DIR__ . '/../..' . '/classes/Hook/HookActionProductCancel.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayBackOfficeHeader' => __DIR__ . '/../..' . '/classes/Hook/HookDisplayBackOfficeHeader.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayFooter' => __DIR__ . '/../..' . '/classes/Hook/HookDisplayFooter.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayFooterProduct' => __DIR__ . '/../..' . '/classes/Hook/HookDisplayFooterProduct.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayHeader' => __DIR__ . '/../..' . '/classes/Hook/HookDisplayHeader.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayHome' => __DIR__ . '/../..' . '/classes/Hook/HookDisplayHome.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookDisplayOrderConfirmation' => __DIR__ . '/../..' . '/classes/Hook/HookDisplayOrderConfirmation.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\HookInterface' => __DIR__ . '/../..' . '/classes/Hook/HookInterface.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Hooks\\WrapperInterface' => __DIR__ . '/../..' . '/classes/Wrapper/WrapperInterface.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Repository\\CarrierRepository' => __DIR__ . '/../..' . '/classes/Repository/CarrierRepository.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Repository\\GanalyticsDataRepository' => __DIR__ . '/../..' . '/classes/Repository/GanalyticsDataRepository.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Repository\\GanalyticsRepository' => __DIR__ . '/../..' . '/classes/Repository/GanalyticsRepository.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Wrapper\\OrderWrapper' => __DIR__ . '/../..' . '/classes/Wrapper/OrderWrapper.php',
'PrestaShop\\Module\\Ps_Googleanalytics\\Wrapper\\ProductWrapper' => __DIR__ . '/../..' . '/classes/Wrapper/ProductWrapper.php',
'Ps_Googleanalytics' => __DIR__ . '/../..' . '/ps_googleanalytics.php',
'ps_GoogleanalyticsAjaxModuleFrontController' => __DIR__ . '/../..' . '/controllers/front/ajax.php',
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->classMap = ComposerStaticInit162ecf782ecf746701d3f22c639569e9::$classMap;
}, null, ClassLoader::class);
}
}

View File

@@ -0,0 +1 @@
[]

View File

@@ -0,0 +1,68 @@
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (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;
}

View File

@@ -0,0 +1,41 @@
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
#content .panel {
margin: 0 auto;
max-width: 1300px;
}
#content .panel p {
margin-bottom:2em;
}
#advantages_list .col-xs-6 {
height:5em;
display: flex;
align-items: center;
}
#advantages_list div > img {
margin: 1em;
width: 60px;
}
#google_analytics_content img {
max-width: 100%;
}

View File

@@ -0,0 +1,28 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (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;

Binary file not shown.

After

Width:  |  Height:  |  Size: 777 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 571 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 607 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@@ -0,0 +1,28 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (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;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 790 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 578 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@@ -0,0 +1,28 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (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;

View File

@@ -0,0 +1,170 @@
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (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');
},
removeFromCart: function(Product) {
this.add(Product);
ga('ec:setAction', 'remove');
ga('send', 'event', 'UX', 'click', 'Remove From cart');
},
addProductImpression: function(Product) {
},
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) {
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) {
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');
},
addCheckoutOption: function(Step,Option) {
ga('ec:setAction', 'checkout_option', {
'step': Step,
'option': Option
});
ga('send', 'event', 'Checkout', 'Option');
}
};

View File

@@ -0,0 +1,28 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (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;

View File

@@ -0,0 +1,59 @@
{**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<div class="panel">
<div class="row" id="google_analytics_top">
<div class="col-lg-6">
<img src="{$module_dir}views/img/ga_logo.png" alt="Google Analytics" />
</div>
<div class="col-lg-6 text-right">
<a href="https://support.google.com/analytics/answer/1008015" rel="external"><img src="{$module_dir}views/img/create_account_btn.png" alt="" /></a>
</div>
</div>
<hr/>
<div id="google_analytics_content">
<div class="row">
<div class="col-lg-6">
<p>
{l s='Your customers go everywhere; shouldn\'t your analytics.' d='Modules.GAnalytics.Admin'}
</p><p>
{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.' d='Modules.GAnalytics.Admin'}
</p>
<p><b>{l s='With ecommerce functionality in Google Analytics you can gain clear insight into important metrics about shopper behavior and conversion, including:' d='Modules.GAnalytics.Admin'}</b></p>
<div id="advantages_list">
<div class="col-xs-6"><img src="{$module_dir}views/img/product_detail_icon.png" alt="" />{l s='Product detail views' d='Modules.GAnalytics.Admin'}</div>
<div class="col-xs-6"><img src="{$module_dir}views/img/merchandising_tools_icon.png" alt="" />{l s='Internal merchandising Success' d='Modules.GAnalytics.Admin'}</div>
<div class="col-xs-6"><img src="{$module_dir}views/img/add_to_cart_icon.png" alt="" />{l s='"Add to cart" actions' d='Modules.GAnalytics.Admin'}</div>
<div class="col-xs-6"><img src="{$module_dir}views/img/checkout_icon.png" alt="" />{l s='The checkout process' d='Modules.GAnalytics.Admin'}</div>
<div class="col-xs-6"><img src="{$module_dir}views/img/campaign_clicks_icon.png" alt="" />{l s='Internal campaign clicks' d='Modules.GAnalytics.Admin'}</div>
<div class="col-xs-6"><img src="{$module_dir}views/img/purchase_icon.png" alt="" />{l s='And purchase' d='Modules.GAnalytics.Admin'}</div>
</div>
</div>
<div class="col-lg-6 text-center">
<p>
<img src="{$module_dir}views/img/stats.png" alt="" /><br />
<span class="small"><em>{l s='Merchants are able to understand how far along users get in the buying process and where they are dropping off.' d='Modules.GAnalytics.Admin'}</em></span>
</p>
<p class="text-right">
<b><a href="https://support.google.com/analytics/answer/1008015" rel="external">{l s='Create your account to get started.' d='Modules.GAnalytics.Admin'}</a></b>
</p>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,28 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (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;

View File

@@ -0,0 +1,32 @@
{**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{if (!empty($jsCode))}
{literal}
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
if (typeof GoogleAnalyticEnhancedECommerce !== 'undefined') {
var MBG = GoogleAnalyticEnhancedECommerce;
MBG.setCurrency('{/literal}{$isoCode|escape:'htmlall':'UTF-8'}{literal}');
{/literal}{$jsCode nofilter}{literal}
}
});
</script>
{/literal}
{/if}

View File

@@ -0,0 +1,28 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (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:
* https://opensource.org/licenses/AFL-3.0
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (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;

Some files were not shown because too many files have changed in this diff Show More