push prod

This commit is contained in:
ToutPratique 2015-12-30 15:59:43 +01:00
parent f65632b5b8
commit 15050fe4c3
33 changed files with 2479 additions and 9 deletions

View File

@ -0,0 +1,93 @@
<h1>{l s='Export des commandes'}</h1>
{if $export == 1}
<div class="conf">
Export réussi : <a href="export_simple.csv" target="_blank">Télécharger</a>
</div>
{/if}
{if $export == 2}
<div class="conf">
Export réussi : <a href="export_product.csv" target="_blank">Télécharger</a>
</div>
{/if}
{if $export == 3}
<div class="conf">
Export réussi : <a href="export_email.csv" target="_blank">Télécharger</a>
</div>
{/if}
<form method="post" action="" name="exportSimple" class="defaultForm" >
<fieldset>
<legend>{l s='Extract 1'}</legend>
<p class="info">1 : Nom du client <br /> 2 : frais de livraison <br /> 3 : pays <br /> 4 : TVA <br /> 5 : TTC<br /> 6 : HT Total produits<br /> 7 : Réduction TTC</p>
<label for="">{l s='Depuis le :'}</label>
<div class="margin-form">
<input type="text" name="date_from" class="datepicker">
</div>
<label for="">{l s='Jusqu\'au :'}</label>
<div class="margin-form">
<input type="text" name="date_to" class="datepicker">
</div>
<div class="margin-form">
<input class="button" type="submit" name="submitExportSimple" value="Exporter">
</div>
</fieldset>
</form>
<br />
<form method="post" action="" name="exportProduit" class="defaultForm" >
<fieldset>
<legend>{l s='Extract 2'}</legend>
<p class="info">1 : Nom du produit <br /> 2 : Quantité France <br /> 3 : Quantité Belgique <br /> 4 : Quantite Italie <br /> 5 : Quantité totale vendue</p>
<label for="">{l s='Depuis le :'}</label>
<div class="margin-form">
<input type="text" name="date_from" class="datepicker">
</div>
<label for="">{l s='Jusqu\'au :'}</label>
<div class="margin-form">
<input type="text" name="date_to" class="datepicker">
</div>
<div class="margin-form">
<input class="button" type="submit" name="submitExportProduit" value="Exporter">
</div>
</fieldset>
</form>
<br />
<form method="post" action="" class="defaultForm" >
<fieldset>
<legend>{l s='Extract 3'}</legend>
<p class="info">1 : Emails commentaires </p>
<label for="">{l s='Depuis le :'}</label>
<div class="margin-form">
<input type="text" name="date_from" class="datepicker">
</div>
<label for="">{l s='Jusqu\'au :'}</label>
<div class="margin-form">
<input type="text" name="date_to" class="datepicker">
</div>
<div class="margin-form">
<input class="button" type="submit" name="submitExportEmail" value="Exporter">
</div>
</fieldset>
</form>
<script>
$(function() {
$( ".datepicker" ).datepicker();
});
</script>

View File

@ -0,0 +1,58 @@
<?php
if (!defined('_CAN_LOAD_FILES_'))
exit;
class Antadis_Export extends Module
{
public function __construct()
{
$this->name = 'antadis_export';
$this->tab = 'administration';
$this->version = '1.0';
$this->author = 'Antadis';
$this->need_instance = 0;
parent::__construct();
$this->displayName = $this->l('Antadis Export');
$this->description = $this->l('Realiser des exports en CSV des commandes');
$this->secure_key = Tools::encrypt($this->name);
$this->confirmUninstall = $this->l('Are you sure ?');
}
public function install(){
$new_tab = new Tab();
$new_tab->class_name = 'AdminAntadisExport';
$new_tab->id_parent = Tab::getCurrentParentId();
$new_tab->module = $this->name;
$languages = Language::getLanguages();
foreach ($languages as $language) {
$new_tab->name[$language['id_lang']] = 'Antadis Exports';
}
$new_tab->add();
if ( !parent::install() ){
$this->uninstall();
return false;
}
return true;
}
public function uninstall(){
if( !parent::uninstall()){
return false;
}
$idTab = Tab::getIdFromClassName('AdminAntadisExport');
if ($idTab) {
$tab = new Tab($idTab);
$tab->delete();
}
return true;
}
}

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>antadis_export</name>
<displayName><![CDATA[Antadis Export]]></displayName>
<version><![CDATA[1.0]]></version>
<description><![CDATA[Realiser des exports en CSV des commandes]]></description>
<author><![CDATA[Antadis]]></author>
<tab><![CDATA[administration]]></tab>
<confirmUninstall>Are you sure ?</confirmUninstall>
<is_configurable>1</is_configurable>
<need_instance>0</need_instance>
<limited_countries></limited_countries>
</module>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>antadis_export</name>
<displayName><![CDATA[Antadis Export]]></displayName>
<version><![CDATA[1.0]]></version>
<description><![CDATA[Realiser des exports en CSV des commandes]]></description>
<author><![CDATA[Antadis]]></author>
<tab><![CDATA[administration]]></tab>
<confirmUninstall><![CDATA[Are you sure ?]]></confirmUninstall>
<is_configurable>0</is_configurable>
<need_instance>0</need_instance>
<limited_countries></limited_countries>
</module>

View File

@ -0,0 +1,261 @@
<?php
class AdminAntadisExportController extends ModuleAdminController {
public function __construct()
{
$this->display = 'add';
$this->bootstrap = true;
parent::__construct();
}
public function setMedia()
{
$this->addJquery();
$this->addJqueryUI('ui.datepicker');
parent::setMedia();
}
public function renderForm()
{
/* Export Commande par Boutique */
$this->fields_form[0]['form'] = array(
'legend' => array(
'title' => $this->l('Export Commande par Boutique'),
'icon' => 'icon-cogs'
),
'input' => array(
array(
'type' => 'date',
'label' => $this->l('Date de début'),
'name' => 'date_from',
'size' => 55,
'required' => true,
'lang' => false
),
array(
'type' => 'date',
'label' => $this->l('Date de fin'),
'name' => 'date_to',
'size' => 55,
'required' => true,
'lang' => false
)
),
'submit' => array(
'title' => $this->l('Exporter'),
'name' => 'submitExportOrder'
)
);
/* Export Stock par Boutique */
$this->fields_form[1]['form'] = array(
'legend' => array(
'title' => $this->l('Export Stock par Boutique'),
'icon' => 'icon-cogs'
),
'submit' => array(
'title' => $this->l('Exporter'),
'name' => 'submitExportStock'
)
);
$this->multiple_fieldsets = true;
return parent::renderForm();
}
public function postProcess(){
if ( Tools::isSubmit('submitExportOrder')){
if ( !Tools::getValue('date_from') ){
$this->errors[] = Tools::displayError('Date de début manquante');
}
if ( !Tools::getValue('date_to') ){
$this->errors[] = Tools::displayError('Date de fin manquante');
}
if ( !count($this->errors) ){
$date_from = Tools::getValue('date_from');
$date_to = Tools::getValue('date_to');
// Check des inputs
if ( !Validate::isDate($date_from) || !Validate::isDate($date_to) )
return($this->errors[] = Tools::displayError('Dates incorrectes'));
if ( new DateTime($date_from) > new DateTime($date_to) )
return($this->errors[] = Tools::displayError('La date de début doit être supérieure à la date de fin '));
if($data = $this->getOrderByDate($date_from, $date_to)){
$this->exportCSV($data, 'order');
}else{
return($this->errors[] = Tools::displayError('Pas de commandes pour cette date'));
}
}else{
return($this->errors);
}
} elseif ( Tools::isSubmit('submitExportStock')){
if($data = $this->getStocks()){
$this->exportCSV($data, 'stock');
}else{
return($this->errors[] = Tools::displayError('Pas de stocks pour cette boutique'));
}
}
parent::postProcess();
}
/*
* Renvoi un détail des commandes sur une plage de temps pour une id shop (si renseignée)
* détail : ref_produit, nom_produit, Total_HT, quantité
*/
public function getOrderByDate($date_from, $date_to)
{
$return = array();
if($id_orders = $this->getOrdersIdByDateAdd($date_from,$date_to)){
foreach($id_orders as $id_order){
$order = new Order($id_order);
if($products = $order->getProducts()){
foreach($products as $product){
$return[] = array(
'id_order' => $order->id,
'reference_order' => $order->reference,
'id_product' => $product['product_id'],
'reference_product' => $product['product_reference'],
'name' => $product['product_name'],
'total_wt' => $product['total_price_tax_excl'],
'total' => $product['total_price_tax_incl'],
'quantity' => $product['product_quantity']
);
}
}
}
}
return $return;
}
/*
* Renvoi un détail du stock pour une boutique
* détail : ref_produit, nom_produit, stock dispo
*/
public function getStocks()
{
$return = array();
$context = Context::getContext();
$id_lang = $context->cookie->id_lang;
if($simple_products = Product::getSimpleProducts( $id_lang )){
foreach ($simple_products as $simple_product) {
$product = new Product($simple_product['id_product'], false, $id_lang );
if( $id_stocks = $product->getWsStockAvailables() ){
foreach ($id_stocks as $id_stock) {
if( $id_stock['id_product_attribute'] ){
$attribute_name = "";
if($attributes = $product->getAttributeCombinationsById( $id_stock['id_product_attribute'] , $id_lang )){
foreach($attributes as $attribute){
$reference = $attribute['reference'];
$attribute_name .= $attribute['group_name'].": ".$attribute['attribute_name']." ";
$stock = $attribute['quantity'];
}
}
$name = $product->name ." ".$attribute_name;
}else{
$stock_available = new StockAvailable($id_stock['id']);
$stock = $stock_available->quantity;
$reference = $product->reference;
$name = $product->name;
}
if(!$reference){
$product->reference;
}
$return[] = array(
'id_product' => $product->id,
'id_product_attribute' => $id_stock['id_product_attribute'],
'product_reference' => $reference,
'name' => $name,
'quantity' => $stock
);
}
}
}
}
return $return;
}
public function exportCsv($items, $type)
{
$context = Context::getContext();
$filename = Tools::str2url($context->shop->name).'_order_'.date('Y-m-d').'.csv';
header('Content-Type: application/force-download; charset=UTF-8');
header('Content-disposition: attachment; filename="'.$filename.'"');
if ($type == 'order'){
$row_definition = array(
'id_order' => 'Id commande',
'reference_order' => 'Reference commande',
'id_product' => 'Id produit',
'reference_product' => 'Reference produit',
'name' => 'Nom produit',
'total_wt' => 'Total HT',
'total' => 'Total TTC',
'quantity' => 'Quantite'
);
} elseif ($type == 'stock'){
$row_definition = array(
'id_product' => 'Id produit',
'id_product_attribute' => 'Id Declinaison',
'product_reference' => 'Reference produit',
'name' => 'Nom produit',
'quantity' => 'Quantite'
);
}
//open file pointer to standard output
$fp = fopen("php://output", 'w+');
// first row
$data = array();
foreach ($row_definition as $col) {
$data[] = $col;
}
fputcsv ($fp, $data, ';');
foreach ($items as $item) {
$data = array();
foreach ($row_definition as $key => $col) {
$data[] = (isset($item[$key]) ? $item[$key] : '');
}
fputcsv ($fp,array_map('utf8_decode', array_values($data)), ';');
}
fclose($fp);
die();
}
public static function getOrdersIdByDateAdd($date_from, $date_to, $id_customer = null, $type = null)
{
$sql = 'SELECT `id_order`
FROM `'._DB_PREFIX_.'orders`
WHERE DATE_ADD(date_add, INTERVAL -1 DAY) <= \''.pSQL($date_to).'\' AND date_add >= \''.pSQL($date_from).'\'
'.Shop::addSqlRestriction()
.($type ? ' AND `'.bqSQL($type).'_number` != 0' : '')
.($id_customer ? ' AND id_customer = '.(int)$id_customer : '');
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
$orders = array();
foreach ($result as $order) {
$orders[] = (int)$order['id_order'];
}
return $orders;
}
}

View File

@ -0,0 +1,35 @@
<?php
/*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Location: ../");
exit;

BIN
modules/antadis_export/logo.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 778 B

BIN
modules/antadis_export/logo.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -0,0 +1,5 @@
2014-04-22 18:58:36 +0200 // Changelog updated
2014-04-17 11:39:55 +0200 Bug fix (PS 1.5): ps_version_compliancy removed
2014-03-26 18:48:51 +0100 // Fix unquoted version number
2014-03-24 18:26:25 +0100 / MO gapi : ps_versions_compliancy added
2014-03-21 10:55:03 +0100 Initial commit

37
modules/gapi/Readme.md Normal file
View File

@ -0,0 +1,37 @@
# Google Analytics API
## About
## Contributing
PrestaShop modules are open-source extensions to the PrestaShop e-commerce solution. Everyone is welcome and even encouraged to contribute with their own improvements.
### Requirements
Contributors **must** follow the following rules:
* **Make your Pull Request on the "dev" branch**, NOT the "master" branch.
* Do not update the module's version number.
* Follow [the coding standards][1].
### Process in details
Contributors wishing to edit a module's files should follow the following process:
1. Create your GitHub account, if you do not have one already.
2. Fork the gapi 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

View File

@ -0,0 +1,19 @@
{
"name": "prestashop/gapi",
"description": "PrestaShop module gapi",
"homepage": "https://github.com/PrestaShop/gapi",
"license": "AFL - Academic Free License (AFL 3.0)",
"authors": [
{
"name": "PrestaShop SA",
"email": "contact@prestashop.com"
}
],
"require": {
"php": ">=5.3.2"
},
"config": {
"preferred-install": "dist"
},
"type": "prestashop-module"
}

12
modules/gapi/config.xml Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>gapi</name>
<displayName><![CDATA[Google Analytics API]]></displayName>
<version><![CDATA[1.2.1]]></version>
<description><![CDATA[]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[administration]]></tab>
<is_configurable>1</is_configurable>
<need_instance>0</need_instance>
<limited_countries></limited_countries>
</module>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>gapi</name>
<displayName><![CDATA[API Google Analytics]]></displayName>
<version><![CDATA[1.2.1]]></version>
<description><![CDATA[]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[administration]]></tab>
<is_configurable>1</is_configurable>
<need_instance>0</need_instance>
<limited_countries></limited_countries>
</module>

566
modules/gapi/gapi.php Normal file
View File

@ -0,0 +1,566 @@
<?php
/*
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2015 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
if (!defined('_PS_VERSION_'))
exit;
class Gapi extends Module
{
public function __construct()
{
$this->name = 'gapi';
$this->tab = 'administration';
$this->version = '1.2.1';
$this->author = 'PrestaShop';
$this->need_instance = 0;
$this->bootstrap = true;
parent::__construct();
$this->displayName = $this->l('Google Analytics API');
}
public function isConfigured()
{
if (!$this->active)
return false;
if (Configuration::get('PS_GAPI_VERSION') == 30)
return $this->api_3_0_isConfigured();
elseif (Configuration::get('PS_GAPI_VERSION') == 13)
return $this->api_1_3_isConfigured();
return false;
}
public function getContent()
{
$html = '';
// Check configuration
$allow_url_fopen = ini_get('allow_url_fopen');
$openssl = extension_loaded('openssl');
$curl = extension_loaded('curl');
$ping = (($allow_url_fopen || $curl) && $openssl && Tools::file_get_contents('https://developers.google.com/'));
$online = (in_array(Tools::getRemoteAddr(), array('127.0.0.1', '::1')) ? false : true);
if (!$ping || !$online)
{
$html .= $this->displayError('<ul>
'.(($curl && $allow_url_fopen) ? '' : '<li>'.$this->l('You are not allowed to open external URLs').'</li>').'
'.(($curl && $allow_url_fopen) ? '' : '<li>'.$this->l('cURL is not enabled').'</li>').'
'.($openssl ? '' : '<li>'.$this->l('OpenSSL is not enabled').'</li>').'
'.(($allow_url_fopen && $openssl && !$ping) ? '<li>'.$this->l('Google is unreachable (check your firewall)').'</li>' : '').'
'.($online ? '' : '<li>'.$this->l('You are currently testing your shop on a local server. In order to enjoy the full features, you need to put your shop on an online server.').'</li>').'
</ul>');
}
$html .= '
<div class="info">
'.$this->l('Please be aware the Google Analytics API module will only work if you either:').'
<ul>
<li>'.$this->l('have installed and configured the “Google Analytics” module').'</li>
<li>'.$this->l('or have already embedded the Google Analytics script into your shop.').'</li>
</ul>
</div>';
if (Tools::getValue('PS_GAPI_VERSION'))
Configuration::updateValue('PS_GAPI_VERSION', (int)Tools::getValue('PS_GAPI_VERSION'));
$helper = new HelperOptions($this);
$helper->id = $this->id;
$helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name;
$helper->token = Tools::getAdminTokenLite('AdminModules');
$helper->module = $this;
$fields_options = array(
'general' => array(
'title' => $this->l('Which Google Analytics API version do you want to use?'),
'fields' => $fields = array(
'PS_GAPI_VERSION' => array(
'type' => 'radio',
'choices' => array(
13 => $this->l('v1.3: easy to configure but deprecated and less secure'),
30 => $this->l('v3.0 with OAuth 2.0: most powerful and up-to-date version')
),
'visibility' => Shop::CONTEXT_SHOP
)
),
'submit' => array('title' => $this->l('Save and configure')),
)
);
$helper->tpl_vars = array('currentIndex' => $helper->currentIndex);
$html .= $helper->generateOptions($fields_options);
if (Configuration::get('PS_GAPI_VERSION') == 30)
$html .= $this->api_3_0_getContent();
elseif (Configuration::get('PS_GAPI_VERSION') == 13)
$html .= $this->api_1_3_getContent();
return $html;
}
public function requestReportData($dimensions, $metrics, $date_from = null, $date_to = null, $sort = null, $filters = null, $start = 1, $limit = 30)
{
if (Configuration::get('PS_GAPI_VERSION') == 30)
return $this->api_3_0_requestReportData($dimensions, $metrics, $date_from, $date_to, $sort, $filters, $start, $limit);
elseif (Configuration::get('PS_GAPI_VERSION') == 13)
return $this->api_1_3_requestReportData($dimensions, $metrics, $date_from, $date_to, $sort, $filters, $start, $limit);
}
public function api_3_0_authenticate()
{
$shop = new Shop(Shop::getContextShopID());
// https://developers.google.com/accounts/docs/OAuth2WebServer
$params = array(
'response_type' => 'code',
'client_id' => Configuration::get('PS_GAPI30_CLIENT_ID_TMP'),
'scope' => 'https://www.googleapis.com/auth/analytics.readonly',
'redirect_uri' => $shop->getBaseURL(true).'modules/'.$this->name.'/oauth2callback.php',
'state' => $this->context->employee->id.'-'.Tools::encrypt($this->context->employee->id.Configuration::get('PS_GAPI30_CLIENT_ID_TMP')),
'approval_prompt' => 'force',
'access_type' => 'offline'
);
Tools::redirectLink('https://accounts.google.com/o/oauth2/auth?'.http_build_query($params));
}
public function api_3_0_refreshtoken()
{
$params = array(
'client_id' => Configuration::get('PS_GAPI30_CLIENT_ID'),
'client_secret' => Configuration::get('PS_GAPI30_CLIENT_SECRET')
);
// https://developers.google.com/accounts/docs/OAuth2WebServer#offline
if (Configuration::get('PS_GAPI30_REFRESH_TOKEN'))
{
$params['grant_type'] = 'refresh_token';
$params['refresh_token'] = Configuration::get('PS_GAPI30_REFRESH_TOKEN');
}
else
{
$shop = new Shop(Shop::getContextShopID());
$params['grant_type'] = 'authorization_code';
$params['code'] = Configuration::get('PS_GAPI30_AUTHORIZATION_CODE');
$params['redirect_uri'] = $shop->getBaseURL(true).'modules/'.$this->name.'/oauth2callback.php';
}
$content = http_build_query($params);
$stream_context = stream_context_create(array(
'http' => array(
'method'=> 'POST',
'content' => $content,
'header' => "Content-type: application/x-www-form-urlencoded\r\nContent-length: ".strlen($content)."\r\n",
'timeout' => 5,
)
));
if (!$response_json = Tools::file_get_contents('https://accounts.google.com/o/oauth2/token', false, $stream_context))
return false;
$response = Tools::jsonDecode($response_json, true);
if (isset($response['error']))
return false;
Configuration::updateValue('PS_GAPI30_ACCESS_TOKEN', $response['access_token']);
Configuration::updateValue('PS_GAPI30_TOKEN_EXPIRATION', time() + (int)$response['expires_in']);
if (isset($response['refresh_token']))
Configuration::updateValue('PS_GAPI30_REFRESH_TOKEN', $response['refresh_token']);
return true;
}
public function api_3_0_isConfigured()
{
return (Configuration::get('PS_GAPI30_CLIENT_ID') && Configuration::get('PS_GAPI30_CLIENT_SECRET') && Configuration::get('PS_GAPI_PROFILE'));
}
public function api_3_0_getContent()
{
$html = '';
if (Tools::getValue('PS_GAPI30_CLIENT_ID'))
{
Configuration::updateValue('PS_GAPI30_REQUEST_URI_TMP', dirname($_SERVER['REQUEST_URI']).'/'.AdminController::$currentIndex.'&configure='.$this->name.'&token='.Tools::getAdminTokenLite('AdminModules'));
Configuration::updateValue('PS_GAPI30_CLIENT_ID_TMP', trim(Tools::getValue('PS_GAPI30_CLIENT_ID')));
Configuration::updateValue('PS_GAPI30_CLIENT_SECRET_TMP', trim(Tools::getValue('PS_GAPI30_CLIENT_SECRET')));
Configuration::updateValue('PS_GAPI_PROFILE_TMP', trim(Tools::getValue('PS_GAPI_PROFILE')));
// This will redirect the user to Google API authentication page
$this->api_3_0_authenticate();
}
elseif (Tools::getValue('oauth2callback') == 'error')
$html .= $this->displayError('Google API: Access denied');
elseif (Tools::getValue('oauth2callback') == 'undefined')
$html .= $this->displayError('Something wrong happened with Google API authorization');
elseif (Tools::getValue('oauth2callback') == 'success')
{
if ($this->api_3_0_refreshtoken())
$html .= $this->displayConfirmation('Google API Authorization granted');
else
$html .= $this->displayError('Google API Authorization granted but access token cannot be retrieved');
}
$display_slider = true;
if ($this->api_3_0_isConfigured())
{
$result_test = $this->api_3_0_requestReportData('', 'ga:visits,ga:uniquePageviews', date('Y-m-d', strtotime('-1 day')), date('Y-m-d', strtotime('-1 day')), null, null, 1, 1);
if (!$result_test)
$html .= $this->displayError('Cannot retrieve test results');
else
{
$display_slider = false;
$html .= $this->displayConfirmation(sprintf($this->l('Yesterday, your store received the visit of %d people for a total of %d unique page views.'), $result_test[0]['metrics']['visits'], $result_test[0]['metrics']['uniquePageviews']));
}
}
if ($display_slider)
{
$shop = new Shop(Shop::getContextShopID());
$authorized_origin = $shop->domain;
$authorized_redirect = $shop->domain.$shop->getBaseURI().'modules/'.$this->name.'/oauth2callback.php';
$slides = array(
'Google API - 01 - Start.png' => $this->l('Go to https://code.google.com/apis/console and click the "Create Project" button'),
'Google API - 02 - Services.png' => $this->l('In the "APIS & AUTH > APIs" tab, switch on the Analytics API'),
'Google API - 03 - Terms.png' => $this->l('You may be asked to agree to the Terms of Service of Google APIs and Analytics API'),
'Google API - 04 - Services OK.png' => $this->l('You should now have something like that'),
'Google API - 05 - API Access.png' => $this->l('In the "APIS & AUTH > Credentials" tab, click the first, red, "Create new Client ID" button'),
'Google API - 06 - Create Client ID.png' =>
sprintf($this->l('Keep "Web application" selected and fill in the "Authorized Javascript Origins" area with "%s" and "%s" then the "Authorized Redirect URI" area with "%s" and "%s".'), 'http://'.$authorized_origin, 'https://'.$authorized_origin, 'http://'.$authorized_redirect, 'https://'.$authorized_redirect).'
<br />'.$this->l('Then validate by clicking the "Create client ID" button'),
'Google API - 07 - API Access created.png' => $this->l('You should now have the following screen. Copy/Paste the "Client ID" and "Client secret" into the form below'),
'Google API - 08 - Profile ID.png' => $this->l('Now you need the ID of the Analytics Profile you want to connect. In order to find your Profile ID, connect to the Analytics dashboard, then look at the URL in the address bar. Your Profile ID is the number following a "p", as shown underlined in red on the screenshot')
);
$first_slide = key($slides);
$html .= '
<a id="screenshots_button" href="#screenshots"><button class="btn btn-default"><i class="icon-question-sign"></i> How to configure Google Analytics API</button></a>
<div style="display:none">
<div id="screenshots" class="carousel slide">
<ol class="carousel-indicators">';
$i = 0;
foreach ($slides as $slide => $caption)
$html .= '<li data-target="#screenshots" data-slide-to="'.($i++).'" '.($slide == $first_slide ? 'class="active"' : '').'></li>';
$html .= '
</ol>
<div class="carousel-inner">';
foreach ($slides as $slide => $caption)
$html .= '
<div class="item '.($slide == $first_slide ? 'active' : '').'">
<img src="'.$this->_path.'screenshots/3.0/'.$slide.'" style="margin:auto">
<div style="text-align:center;font-size:1.4em;margin-top:10px;font-weight:700">
'.$caption.'
</div>
<div class="clear">&nbsp;</div>
</div>';
$html .= '
</div>
<a class="left carousel-control" href="#screenshots" data-slide="prev">
<span class="icon-prev"></span>
</a>
<a class="right carousel-control" href="#screenshots" data-slide="next">
<span class="icon-next"></span>
</a>
</div>
</div>
<div class="clear">&nbsp;</div>
<script type="text/javascript">
$(document).ready(function(){
$("a#screenshots_button").fancybox();
$("#screenshots").carousel({interval:false});
$("ol.carousel-indicators").remove();
});
</script>';
}
$helper = new HelperOptions($this);
$helper->id = $this->id;
$helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name;
$helper->token = Tools::getAdminTokenLite('AdminModules');
$helper->module = $this;
$fields_options = array(
'general' => array(
'title' => $this->l('Google Analytics API v3.0'),
'fields' => $fields = array(
'PS_GAPI30_CLIENT_ID' => array(
'title' => $this->l('Client ID'),
'type' => 'text'
),
'PS_GAPI30_CLIENT_SECRET' => array(
'title' => $this->l('Client Secret'),
'type' => 'text'
),
'PS_GAPI_PROFILE' => array(
'title' => $this->l('Profile'),
'type' => 'text'
)
),
'submit' => array('title' => $this->l('Save and Authenticate')),
)
);
$helper->tpl_vars = array('currentIndex' => $helper->currentIndex);
return $html.$helper->generateOptions($fields_options);
}
public function api_3_0_oauth2callback()
{
if (!Tools::getValue('state'))
die ('token missing');
$state = explode('-', Tools::getValue('state'));
if (count($state) != 2)
die ('token malformed');
if ($state[1] != Tools::encrypt($state[0].Configuration::get('PS_GAPI30_CLIENT_ID_TMP')))
die ('token not valid');
$oauth2callback = 'undefined';
$url = Configuration::get('PS_GAPI30_REQUEST_URI_TMP');
if (Tools::getValue('error'))
$oauth2callback = 'error';
elseif (Tools::getValue('code'))
{
Configuration::updateValue('PS_GAPI30_CLIENT_ID', Configuration::get('PS_GAPI30_CLIENT_ID_TMP'));
Configuration::updateValue('PS_GAPI30_CLIENT_SECRET', Configuration::get('PS_GAPI30_CLIENT_SECRET_TMP'));
Configuration::updateValue('PS_GAPI_PROFILE', Configuration::get('PS_GAPI_PROFILE_TMP'));
Configuration::updateValue('PS_GAPI30_AUTHORIZATION_CODE', Tools::getValue('code'));
$oauth2callback = 'success';
}
Configuration::deleteFromContext('PS_GAPI30_CLIENT_ID_TMP');
Configuration::deleteFromContext('PS_GAPI30_CLIENT_SECRET_TMP');
Configuration::deleteFromContext('PS_GAPI_PROFILE_TMP');
Configuration::deleteFromContext('PS_GAPI30_REQUEST_URI_TMP');
Configuration::deleteFromContext('PS_GAPI30_REFRESH_TOKEN');
Tools::redirectAdmin($url.'&oauth2callback='.$oauth2callback);
}
// https://developers.google.com/analytics/devguides/reporting/core/dimsmets
// requestReportData('ga:country', 'ga:visits', '2013-08-25', '2013-08-25', null, null, 1, 1000);
protected function api_3_0_requestReportData($dimensions, $metrics, $date_from, $date_to, $sort, $filters, $start, $limit)
{
if (Configuration::get('PS_GAPI30_TOKEN_EXPIRATION') < time() + 30 && !$this->api_3_0_refreshtoken())
return false;
$bearer = Configuration::get('PS_GAPI30_ACCESS_TOKEN');
$params = array(
'ids' => 'ga:'.Configuration::get('PS_GAPI_PROFILE'),
'dimensions' => $dimensions,
'metrics' => $metrics,
'sort' => $sort ? $sort : $metrics,
'start-date' => $date_from,
'end-date' => $date_to,
'start-index' => $start,
'max-results' => $limit,
'access_token' => $bearer,
);
if ($filters !== null)
$params['filters'] = $filters;
$content = str_replace('&amp;', '&', urldecode(http_build_query($params)));
$api = ($date_from && $date_to) ? 'ga' : 'realtime';
if (!$response_json = Tools::file_get_contents('https://www.googleapis.com/analytics/v3/data/'.$api.'?'.$content, false))
return false;
// https://developers.google.com/analytics/devguides/reporting/core/v3/reference
$response = Tools::jsonDecode($response_json, true);
$result = array();
if (isset($response['rows']) && is_array($response['rows']))
foreach ($response['rows'] as $row)
{
$metrics = array();
$dimensions = array();
foreach ($row as $key => $value)
if ($response['columnHeaders'][$key]['columnType'] == 'DIMENSION')
$dimensions[str_replace('ga:', '', $response['columnHeaders'][$key]['name'])] = $value;
elseif ($response['columnHeaders'][$key]['columnType'] == 'METRIC')
$metrics[str_replace('ga:', '', $response['columnHeaders'][$key]['name'])] = $value;
$result[] = array('metrics' => $metrics, 'dimensions' => $dimensions);
}
return $result;
}
public function api_1_3_isConfigured()
{
return (Configuration::get('PS_GAPI13_EMAIL') && Configuration::get('PS_GAPI13_PASSWORD') && Configuration::get('PS_GAPI_PROFILE'));
}
public function api_1_3_getContent()
{
$html = '';
if (Tools::isSubmit('PS_GAPI13_EMAIL'))
{
if ($this->api_1_3_authenticate(Tools::getValue('PS_GAPI13_EMAIL'), Tools::getValue('PS_GAPI13_PASSWORD')))
{
Configuration::updateValue('PS_GAPI13_EMAIL', Tools::getValue('PS_GAPI13_EMAIL'));
Configuration::updateValue('PS_GAPI13_PASSWORD', Tools::getValue('PS_GAPI13_PASSWORD'));
Configuration::updateValue('PS_GAPI_PROFILE', Tools::getValue('PS_GAPI_PROFILE'));
}
else
$html .= $this->displayError($this->l('Authentication failed'));
}
if ($this->api_1_3_isConfigured())
{
$result_test = $this->api_1_3_requestReportData('', 'ga:visits,ga:uniquePageviews', date('Y-m-d', strtotime('-1 day')), date('Y-m-d', strtotime('-1 day')), null, null, 1, 1);
if (!$result_test)
$html .= $this->displayError('Cannot retrieve test results');
else
$html .= $this->displayConfirmation(sprintf($this->l('Yesterday, your store received the visit of %d people for a total of %d unique page views.'), $result_test[0]['metrics']['visits'], $result_test[0]['metrics']['uniquePageviews']));
}
$helper = new HelperOptions($this);
$helper->id = $this->id;
$helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name;
$helper->token = Tools::getAdminTokenLite('AdminModules');
$helper->module = $this;
$fields_options = array(
'general' => array(
'title' => $this->l('Google Analytics API v1.3'),
'fields' => $fields = array(
'PS_GAPI13_EMAIL' => array(
'title' => $this->l('Email'),
'type' => 'text'
),
'PS_GAPI13_PASSWORD' => array(
'title' => $this->l('Password'),
'type' => 'password'
),
'PS_GAPI_PROFILE' => array(
'title' => $this->l('Profile'),
'type' => 'text',
'desc' => $this->l('You can find your profile ID in the address bar of your browser while accessing Analytics report.').'<br />'.
$this->l('For the OLD VERSION of Google Analytics, the profile ID is in the URL\'s "id" parameter (see "&id=xxxxxxxx"):').'<br />'.
'https://www.google.com/analytics/reporting/?reset=1&id=XXXXXXXX&pdr=20110702-20110801'.'<br />'.
$this->l('For the NEW VERSION of Google Analytics, the profile ID is the number at the end of the URL, starting with p:').'<br />'.
'https://www.google.com/analytics/web/#home/a11345062w43527078pXXXXXXXX/'
)
),
'submit' => array('title' => $this->l('Save and Authenticate')),
)
);
$helper->tpl_vars = array('currentIndex' => $helper->currentIndex);
return $html.$helper->generateOptions($fields_options);
}
protected function api_1_3_authenticate($email, $password)
{
$stream_context = stream_context_create(array(
'http' => array(
'method'=> 'POST',
'content' => 'accountType=GOOGLE&Email='.urlencode($email).'&Passwd='.urlencode($password).'&source=GAPI-1.3&service=analytics',
'header' => 'Content-type: application/x-www-form-urlencoded'."\r\n",
'timeout' => 5,
)
));
if (!$response = Tools::file_get_contents('https://www.google.com/accounts/ClientLogin', false, $stream_context))
return false;
parse_str(str_replace(array("\n", "\r\n"), '&', $response), $response_array);
if (!is_array($response_array) || !isset($response_array['Auth']) || empty($response_array['Auth']))
return false;
$this->auth_token = $response_array['Auth'];
return true;
}
// requestReportData('ga:country', 'ga:visits', '2013-08-25', '2013-08-25', null, null, 1, 1000);
protected function api_1_3_requestReportData($dimensions, $metrics, $date_from, $date_to, $sort, $filters, $start, $limit)
{
if (!$this->api_1_3_authenticate(Configuration::get('PS_GAPI13_EMAIL'), Configuration::get('PS_GAPI13_PASSWORD')))
return false;
$params = array(
'ids' => 'ga:'.Configuration::get('PS_GAPI_PROFILE'),
'dimensions' => $dimensions,
'metrics' => $metrics,
'sort' => $sort ? $sort : $metrics,
'start-date' => $date_from,
'end-date' => $date_to,
'start-index' => $start,
'max-results' => $limit,
);
if ($filters !== null)
$params['filters'] = $filters;
$content = str_replace('&amp;', '&', urldecode(http_build_query($params)));
$stream_context = stream_context_create(array(
'http' => array(
'method'=> 'GET',
'header' => 'Authorization: GoogleLogin auth='.$this->auth_token."\r\n",
'timeout' => 5,
)
));
if (!$response = Tools::file_get_contents('https://www.google.com/analytics/feeds/data?'.$content, false, $stream_context))
return false;
$xml = simplexml_load_string($response);
/* Meta data not useful at this time */
/*
$report_root_parameters = array();
$report_aggregate_metrics = array();
$google_results = $xml->children('http://schemas.google.com/analytics/2009');
foreach($google_results->dataSource->property as $property_attributes)
$report_root_parameters[str_replace('ga:', '', $property_attributes->attributes()->name)] = strval($property_attributes->attributes()->value);
foreach($google_results->aggregates->metric as $aggregate_metric)
{
$key = str_replace('ga:', '', $aggregate_metric->attributes()->name);
$metric_value = strval($aggregate_metric->attributes()->value);
if (preg_match('/^(\d+\.\d+)|(\d+E\d+)|(\d+.\d+E\d+)$/', $metric_value))
$report_aggregate_metrics[$key] = floatval($metric_value);
else
$report_aggregate_metrics[$key] = intval($metric_value);
}
*/
$result = array();
foreach($xml->entry as $entry)
{
$metrics = array();
foreach ($entry->children('http://schemas.google.com/analytics/2009')->metric as $metric)
{
$key = str_replace('ga:', '', $metric->attributes()->name);
$metric_value = strval($metric->attributes()->value);
if (preg_match('/^(\d+\.\d+)|(\d+E\d+)|(\d+.\d+E\d+)$/', $metric_value))
$metrics[$key] = floatval($metric_value);
else
$metrics[$key] = intval($metric_value);
}
$dimensions = array();
foreach ($entry->children('http://schemas.google.com/analytics/2009')->dimension as $dimension)
$dimensions[str_replace('ga:', '', $dimension->attributes()->name)] = strval($dimension->attributes()->value);
$result[] = array('metrics' => $metrics, 'dimensions' => $dimensions);
}
return $result;
}
}

33
modules/gapi/index.php Normal file
View File

@ -0,0 +1,33 @@
<?php
/*
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2015 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 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;

BIN
modules/gapi/logo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 946 B

BIN
modules/gapi/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,31 @@
<?php
/*
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2015 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
include(dirname(__FILE__).'/../../config/config.inc.php');
include(dirname(__FILE__).'/gapi.php');
$gapi = new Gapi();
$gapi->api_3_0_oauth2callback();

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -0,0 +1,43 @@
<?php
global $_MODULE;
$_MODULE = array();
$_MODULE['<{gapi}prestashop>gapi_69ee9bf9cf3d83a8468278c44959caf0'] = 'API Google Analytics';
$_MODULE['<{gapi}prestashop>gapi_0851f7a0844553fa1168718de0f87262'] = 'Vous n\'avez pas la possibilité d\'ouvrir des URL externes';
$_MODULE['<{gapi}prestashop>gapi_6401593f1412a6b385c8e645d1f056ac'] = 'L\'extension cURL n\'est pas activée';
$_MODULE['<{gapi}prestashop>gapi_f8b94463fa8b5591e5edbbb8021e8038'] = 'OpenSSL n\'est pas activé';
$_MODULE['<{gapi}prestashop>gapi_6e4c3e76dd29876e6d33ce8c89e5fc5f'] = 'Google est inaccessible (vérifiez votre firewall)';
$_MODULE['<{gapi}prestashop>gapi_a1ed99ed6aaac91d7c3b127f032abf2d'] = 'Vous testez actuellement votre boutique sur un serveur local. Pour profiter des toutes les fonctionnalités, il vous faut mettre votre boutique sur un serveur en ligne.';
$_MODULE['<{gapi}prestashop>gapi_0237f944f5335bf28424f65ea896c22e'] = 'Veuillez noter que le module Google Analytics API fonctionnera uniquement si vous avez :';
$_MODULE['<{gapi}prestashop>gapi_cc45f699445b43bb53e2519f013fba91'] = 'installé et configuré le module "Google Analytics"';
$_MODULE['<{gapi}prestashop>gapi_2d79f37dac5a9b0a1188bf50ed241c85'] = 'ou déjà ajouté le script Google Analytics à votre boutique.';
$_MODULE['<{gapi}prestashop>gapi_2ccf68a6aec8eda73156a7ef54b03351'] = 'Quelle version de l\'API Google Analytics voulez-vous utiliser?';
$_MODULE['<{gapi}prestashop>gapi_0caf30452ef28d761ae80a407b64bd9b'] = 'v1.3 : facile à configurer mais dépréciée et moins sécurisée';
$_MODULE['<{gapi}prestashop>gapi_949617ff3314c7cf2d88d356a953bd67'] = 'v3.0 : avec OAuth 2.0, la plus puissante et la plus récente';
$_MODULE['<{gapi}prestashop>gapi_f1f4f41c5cab767032db832ec7bd5b64'] = 'Enregistrer et configurer';
$_MODULE['<{gapi}prestashop>gapi_00e9b476102174b72bce85f57ef4f251'] = 'Hier, votre boutique a reçu des visites de %d personnes pour un total de %d pages vues uniques.';
$_MODULE['<{gapi}prestashop>gapi_ac994aa3de9d2d547a386a0a05aaa4f9'] = 'Rendez-vous sur https://code.google.com/apis/console et cliquez sur le bouton "Créer un projet..."';
$_MODULE['<{gapi}prestashop>gapi_8bc5a7586c07901e92c09835eb4bf999'] = 'Dans l\'onglet "Services", activez l\'API Analytics';
$_MODULE['<{gapi}prestashop>gapi_cc33e14eed388f17b70ffdc1cf135e03'] = 'Il vous sera demandé d\'accepter les conditions de service des API Google';
$_MODULE['<{gapi}prestashop>gapi_6489ed26701b74c0fb139a3368804121'] = 'Vous devrez obtenir quelque chose comme cela';
$_MODULE['<{gapi}prestashop>gapi_ac868e51ad8cfbbe457407b4ed3a94ab'] = 'Dans le menu "APIS & AUTH > Credentials", cliquez sur le premier bouton rouge "Create new Client ID"';
$_MODULE['<{gapi}prestashop>gapi_d8334c85c0164bbdb0b24db654e6b611'] = 'Gardez "Web application" sélectionné et remplissez le champ "Authorized Javascript Origins" avec "%s" et "%s", puis le champ "Authorized Redirect URI" avec "%s" et "%s".';
$_MODULE['<{gapi}prestashop>gapi_4a7ee36b0b566be651113d36e6d87a86'] = 'Ensuite, validez en cliquant sur le bouton "Create client ID"';
$_MODULE['<{gapi}prestashop>gapi_6e1e99918b40cf3f46166fae1e642b73'] = 'Vous devrez maintenant avoir l\'écran suivant. Copiez/collez le "ID client" et le "Secret client" dans le formulaire ci-dessous';
$_MODULE['<{gapi}prestashop>gapi_265c32931719280339cf19d733fea744'] = 'Il vous faut maintenant l\'ID du Profil Analytics auquel vous voulez vous connecter. Pour trouver l\'ID du profil, connectez-vous au tableau de bord Analytics et regardez l\'URL dans la barre d\'adresse. Votre ID de profil est le nombre suivi d\'un "p", comme souligné dans la capture d\'écran.';
$_MODULE['<{gapi}prestashop>gapi_b18cb8e83113953f96bbe47bd90ab69c'] = 'API Google Analytics v3.0';
$_MODULE['<{gapi}prestashop>gapi_76525f0f34b48475e5ca33f71d296f3b'] = 'ID client';
$_MODULE['<{gapi}prestashop>gapi_734082edf44417dd19cc65943aa65c36'] = 'Secret client';
$_MODULE['<{gapi}prestashop>gapi_cce99c598cfdb9773ab041d54c3d973a'] = 'Profil';
$_MODULE['<{gapi}prestashop>gapi_b1a026d322c634ca9e88525070e012fd'] = 'Enregistrer et se connecter à l\'API';
$_MODULE['<{gapi}prestashop>gapi_d4e6d6c42bf3eb807b8778255a4ce415'] = 'Echec lors de l\'authentification';
$_MODULE['<{gapi}prestashop>gapi_a670b4cdb42644e4b46fa857d3f73d9e'] = 'API Google Analytics v1.3';
$_MODULE['<{gapi}prestashop>gapi_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'E-mail';
$_MODULE['<{gapi}prestashop>gapi_dc647eb65e6711e155375218212b3964'] = 'Mot de passe';
$_MODULE['<{gapi}prestashop>gapi_970a710b7344f8639b6a86d1f081b660'] = 'Vous trouverez l\'identifiant de profil (\\"Profile ID\\") dans la barre d\'adresse de votre navigateur lorsque vous consultez le rapport sur le site de Google Analytics.';
$_MODULE['<{gapi}prestashop>gapi_e33d3b3409f8a0fcc326596c918c4961'] = 'Pour l\'ANCIENNE version de Google Analytics, l\'ID du profil est dans le paramètre "id" de l\'URL (voir "&id=xxxxxxxx") :';
$_MODULE['<{gapi}prestashop>gapi_c78fedea48082c7a437773e31b418f96'] = 'Pour la NOUVELLE VERSION de Google Analytics, l\'ID du profile est le numéro situé à la fin de l\'adresse, commençant par un p :';
return $_MODULE;

View File

@ -0,0 +1,35 @@
<?php
/*
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2015 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
header("Expires: Mon, 26 Jul 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

@ -2,7 +2,7 @@
<module>
<name>homeslider</name>
<displayName><![CDATA[Diaporama (image slider) pour votre page d&#039;accueil]]></displayName>
<version><![CDATA[1.5.0]]></version>
<version><![CDATA[1.6.0]]></version>
<description><![CDATA[Ajouter un carrousel d&#039;images &agrave; votre page d&#039;accueil]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>

File diff suppressed because it is too large Load Diff

View File

@ -202,17 +202,12 @@ $_LANG['live_edit_ea4788705e6873b424c65e91c2846b19'] = 'Annuler';
$_LANG['maintenance_38a27c0c7ef7a05e13efa2798ee21533'] = 'Mode maintenance';
$_LANG['maintenance_a022ff58716d4cf34050cb68e7f12fcf'] = 'Nous nous excusons pour la gêne occasionnée. Merci de revenir plus tard.';
$_LANG['maintenance_fef882af64a6b9c88dbc5e6cce2607bc'] = 'Pour cause de maintenance, votre boutique en ligne est temporairement inaccessible.';
$_LANG['manufacturer-list_0397cbccfd02272abd38f8933b865218'] = '%d produit';
$_LANG['manufacturer-list_0e1e874dde345d19583102a9fd63fb7e'] = 'Fabricants :';
$_LANG['manufacturer-list_3426bf3cca12b1f6550fd8bd36171e2f'] = 'afficher les produits';
$_LANG['manufacturer-list_4ee29ca12c7d126654bd0e5275de6135'] = 'Liste';
$_LANG['manufacturer-list_5174d1309f275ba6f275db3af9eb3e18'] = 'Grille';
$_LANG['manufacturer-list_84be54bb4bd1b755a27d86388700d097'] = 'Marques';
$_LANG['manufacturer-list_864c665aea5e824772fda0e678c3ac4d'] = '%d produits';
$_LANG['manufacturer-list_ac27bfc960343d2e6222945cc50f2405'] = 'Il y a une marque';
$_LANG['manufacturer-list_ce7bdbaa2a5998973271d85172456ee6'] = 'Il n\'y aucun fabricant.';
$_LANG['manufacturer-list_df25de42c84837baf5fa15049a8bc764'] = 'Afficher :';
$_LANG['manufacturer-list_f84855a18b9b3e1cd70f2b2cde5778b4'] = 'Il y a %d marques';
$_LANG['manufacturer_a65ed5e8df4b1c2bb34844f81cc9b451'] = 'Pas de produit pour ce fabricant.';
$_LANG['manufacturer_d3da97e2d9aee5c8fbe03156ad051c99'] = 'Détails';
$_LANG['menu-account_0323de4f66a1700e2173e9bcdce02715'] = 'Déconnexion';
@ -552,7 +547,6 @@ $_LANG['product_3b6d056ac93fc7b1947c3bc2ce720aaf'] = 'Veuillez remplir tous les
$_LANG['product_3f66e58ff7d090c76a1be060627313c3'] = 'à partir de 50€';
$_LANG['product_476efcbaed950dd513ffc08e4e9a632f'] = 'Envoi en cours, veuillez patienter...';
$_LANG['product_63a78ed4647f7c63c2929e35ec1c95e3'] = 'Personnaliser';
$_LANG['product_67de568f2f9ecee546f27800c26475fa'] = ' ';
$_LANG['product_694e8d1f2ee056f98ee488bdc4982d73'] = 'Quantité :';
$_LANG['product_7dcd185f890fd28f69d1ed210292d77f'] = 'Fiche technique';
$_LANG['product_801ab24683a4a8c433c6eb40c48bcd9d'] = 'Télécharger';

View File

@ -50,11 +50,11 @@ $_MODULE['<{blocknewsletter}toutpratique>blocknewsletter_416f61a2ce16586f8289d41
$_MODULE['<{blocknewsletter}toutpratique>blocknewsletter_footer_4f25affba562b4536bb64201db470c80'] = 'Profitez d\'une';
$_MODULE['<{blocknewsletter}toutpratique>blocknewsletter_footer_d1c360c7c14151f612578c2e96da64bb'] = 'réduction de 10€';
$_MODULE['<{blocknewsletter}toutpratique>blocknewsletter_footer_fa3ec0af6f82985bf57a7f67866d7a3c'] = 'tout de suite !';
$_MODULE['<{blocknewsletter}toutpratique>blocknewsletter_footer_28dc737bd6ab81419506ee868af88de4'] = 'Abonnez-vous à ma sélection d\'astuces et conseils mensuels et recevez immédiatement un bon de réduction de 10 €* valable sur toute la boutique ToutPratique.com ! (*pour un montant d\'achat minimum de 30€)';
$_MODULE['<{blocknewsletter}toutpratique>blocknewsletter_footer_28dc737bd6ab81419506ee868af88de4'] = 'Abonnez-vous à ma sélection d\'astuces et conseils hebdomadaires et recevez immédiatement un bon de réduction de 10 €* valable sur toute la boutique ToutPratique.com ! (*pour un montant d\'achat minimum de 30€)';
$_MODULE['<{blocknewsletter}toutpratique>blocknewsletter_footer_47d847fc07bc04ab53eca002bd4b3511'] = 'Recevez';
$_MODULE['<{blocknewsletter}toutpratique>blocknewsletter_footer_ed3cb77ca8d30accdc421f9dd8999dad'] = 'gratuitement';
$_MODULE['<{blocknewsletter}toutpratique>blocknewsletter_footer_11425ce33555d6f74532e1da6371bab5'] = 'mon guide !';
$_MODULE['<{blocknewsletter}toutpratique>blocknewsletter_footer_c91bd69ef37b08a590f17900efdae34a'] = 'Abonnez-vous à ma sélection d\'astuces et conseils mensuels et recevez immédiatemment mon guide du Tout Propre en PDF par email! ';
$_MODULE['<{blocknewsletter}toutpratique>blocknewsletter_footer_c91bd69ef37b08a590f17900efdae34a'] = 'Abonnez-vous à ma sélection d\'astuces et conseils hebdomadaires et recevez immédiatemment mon guide du Tout Propre en PDF par email! ';
$_MODULE['<{blocknewsletter}toutpratique>blocknewsletter_footer_336e38c85b28393a18cbf3a56e3011b2'] = 'Mon adresse mail';
$_MODULE['<{blocknewsletter}toutpratique>blocknewsletter_footer_1c6adbea84e42cef343cbb8d6b9cc98d'] = 'Recevoir maintenant';
$_MODULE['<{blocknewsletter}toutpratique>blocknewsletter_footer_d8335f4a5d918134bd0bdc47cc487d74'] = 'Saisissez votre adresse e-mail';

Binary file not shown.