This commit is contained in:
2025-04-01 00:38:54 +02:00
parent d4d4c0c09d
commit 87da06293a
22351 changed files with 5168854 additions and 7538 deletions

View File

@@ -0,0 +1,35 @@
<?php
/*
* 2007-2014 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-2014 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: ../../');

View File

@@ -0,0 +1,22 @@
/*
* PrestaShop module created by VEKIA, a guy from official PrestaShop community ;-)
*
* @author VEKIA https://www.prestashop.com/forums/user/132608-vekia/
* @copyright 2010-2020 VEKIA
* @license This program is not free software and you can't resell and redistribute it
*
* CONTACT WITH DEVELOPER http://mypresta.eu
* support@mypresta.eu
*/
prestashop.on("updatedProduct", function (event) {
if (typeof reinitaddtocart === 'function') {
reinitaddtocart();
}
});
function recalculatePrice(price, from, to, contents, type, currency) {
$.post(prestashop.urls.base_url, {price: price, ajax: 1, fbpixel_recalculate_currency: 1, fbpixel_currency_from: from, fbpixel_currency_to: to}, function (data) {
fbq('track', 'AddToCart', {content_ids: contents, content_type: type, value: data, currency: currency});
});
}

View File

@@ -0,0 +1,35 @@
<?php
/*
* 2007-2014 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-2014 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: ../../');

View File

@@ -0,0 +1,36 @@
{*
* PrestaShop module created by VEKIA, a guy from official PrestaShop community ;-)
*
* @author VEKIA https://www.prestashop.com/forums/user/132608-vekia/
* @copyright 2010-2020 VEKIA
* @license This program is not free software and you can't resell and redistribute it
*
* CONTACT WITH DEVELOPER http://mypresta.eu
* support@mypresta.eu
*}
{if $order_id == false && Tools::getValue('debug') == 1}
<div class="alert alert-warning">
{l s='Payment module does not include id_order or id_cart param. It is not possible to create purchase event tracking (fb pixel).' mod='fbpixel'}
</div>
{else}
{if Configuration::get('FBPIXEL_PURCHASE')==1}
{if Configuration::get('FBPIXEL_DPA')==1}
{literal}
<script>
document.addEventListener("DOMContentLoaded", function (event) {
fbq('track', 'Purchase', {value: '{/literal}{if $FBPIXEL_CONCURR}{Tools::convertPriceFull($order_total_paid, $currency_from, $currency_to)}{else}{$order_total_paid}{/if}{literal}', content_type: 'product', content_ids: [{/literal}{$content_ids nofilter}{literal}], currency: '{/literal}{if $FBPIXEL_CONCURR}{$currency_to->iso_code}{else}{$order_currency_iso_code}{/if}{literal}'});
});
</script>
{/literal}
{else}
{literal}
<script>
document.addEventListener("DOMContentLoaded", function (event) {
fbq('track', 'Purchase', {value: '{/literal}{if $FBPIXEL_CONCURR}{Tools::convertPriceFull($order_total_paid, $currency_from, $currency_to)}{else}{$order_total_paid}{/if}{literal}', currency: '{/literal}{if $FBPIXEL_CONCURR}{$currency_to->iso_code}{else}{$order_currency_iso_code}{/if}{literal}'});
});
</script>
{/literal}
{/if}
{/if}
{/if}

View File

@@ -0,0 +1,158 @@
{*
* PrestaShop module created by VEKIA, a guy from official PrestaShop community ;-)
*
* @author VEKIA https://www.prestashop.com/forums/user/132608-vekia/
* @copyright 2010-2020 VEKIA
* @license This program is not free software and you can't resell and redistribute it
*
* CONTACT WITH DEVELOPER http://mypresta.eu
* support@mypresta.eu
*}
{if Tools::getValue('ajax','false') == 'false' && Tools::getValue('add','false') == 'false' && Tools::getValue('action') != 'productrefresh' && (Tools::getValue('submitMessage','false') == 'false' && Tools::getValue('msgText','false') == 'false') && (Tools::getValue('add_comment','false')=='false' && Tools::getValue('action') != 'add_comment') && Tools::getValue('criterion','false') == 'false' && Tools::getValue('controller')!='productscomparison'}
{literal}
<script>
var prefix = '{/literal}{$prefix|escape:quotes}{literal}';
var sufix = '{/literal}{$sufix|escape:quotes}{literal}';
function getURLParameter(url, name) {
return (RegExp(name + '=' + '(.+?)(&|$)').exec(url)||[,null])[1];
}
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','https://connect.facebook.net/en_US/fbevents.js');
{/literal}
{foreach $fbpixel_id_array as $pixel_id}
fbq('init', '{$pixel_id}');
{/foreach}
{if Configuration::get('FBPIXEL_PAGEVIEW')==1}
fbq('track', "PageView");
{/if}
{if Configuration::get('FBPIXEL_LEAD')==1}
{if Tools::getValue('controller')=='product'}
{if Tools::getValue('id_product','false')!='false'}
fbq('track', 'Lead');
{/if}
{/if}
{/if}
{if Configuration::get('FBPIXEL_LEAD_N') == 1 && $track_newsletter == true}
fbq('track', 'Lead', {
content_name: 'newsletter subscription'
});
{/if}
{if Configuration::get('FBPIXEL_REG')==1}
{if isset($account_created)}
fbq('track', "CompleteRegistration");
{/if}
{/if}
{if Configuration::get('FBPIXEL_INITIATE')==1}
{if Tools::getValue('controller')=='order' || Tools::getValue('controller')=='orderopc'}
{if Configuration::get('FBPIXEL_INITIATE_D')==1}
{literal}fbq('track', 'InitiateCheckout', {value: '{/literal}{if $FBPIXEL_CONCURR}{Tools::convertPriceFull($order_total_paid, $currency_from, $currency_to)}{else}{$order_total_paid}{/if}{literal}', content_type: 'product', content_ids: [{/literal}{$content_ids nofilter}{literal}], currency: '{/literal}{if $FBPIXEL_CONCURR}{$currency_to->iso_code}{else}{$order_currency_iso_code}{/if}{literal}'});{/literal}
{else}
fbq('track', 'InitiateCheckout');
{/if}
{/if}
{/if}
{if Configuration::get('FBPIXEL_SEARCH')==1}
{if Tools::getValue('controller')=='search'}
fbq('track', 'Search');
{/if}
{/if}
{if Configuration::get('FBPIXEL_WISHLIST')==1}
document.addEventListener("DOMContentLoaded", function(event) {
$('#wishlist_button_nopop').click(function(){
fbq('track', 'AddToWishlist');
});
});
{/if}
{* ADD TO CART + DPA *}
{* ADD TO CART + DPA *}
{* ADD TO CART + DPA *}
{if Configuration::get('FBPIXEL_DPA')==1}
{if Configuration::get('FBPIXEL_VCONTENT') == 1}
{if Tools::getValue('id_product','false') != 'false' && $fbpixel_product != NULL}
{assign var=product_price value=$fbpixel_product->getPrice(true, $smarty.const.NULL)}
document.addEventListener("DOMContentLoaded", function(event) {
var json = $.parseJSON($('#product-details').attr('data-product'));
var ids=prefix+{if Configuration::get('FBPIXEL_ATTRID') == 1}json['id_product_attribute']{elseif Configuration::get('FBPIXEL_ATTRID') == 2}{Tools::getValue('id_product')}+'{Configuration::get('FBPIXEL_SEPSIGN','-')}'+json['id_product_attribute']{else}{Tools::getValue('id_product')}{/if}+sufix;
fbq('track', 'ViewContent', {
content_name: '{$fbpixel_product->name|escape:javascript}',
content_ids: [ids],
content_type: 'product',
value: {if $FBPIXEL_CONCURR}{Tools::convertPriceFull($product_price|string_format:"%.2f", $currency_from, $currency_to)}{else}{$product_price|string_format:"%.2f"}{/if},
currency: '{$fbpixel_currency}'
});
});
{/if}
{/if}
function reinitaddtocart() {
{if Configuration::get('FBPIXEL_ADDTOCART')==1}
{if Tools::getValue('controller')=='product'}
var json = $.parseJSON($('#product-details').attr('data-product'));
$('{Configuration::get('FBPIXEL_ATC_B')}').click(function(){
var productPagePrice = $(this).parents('body').find('{Configuration::get('FBPIXEL_ATC_PPP')}').html();
if (productPagePrice == undefined) {
var productPagePrice = 0.000;
}
productPagePrice = productPagePrice.replace(/[^\d.\,-]/g, '');
productPagePrice = productPagePrice.replace(',','.');
if (productPagePrice[productPagePrice.length-1] === ".")
{
productPagePrice = productPagePrice.slice(0, -1);
}
{if $FBPIXEL_CONCURR}
recalculatePrice(productPagePrice, {$currency_from->id}, {$currency_to->id}, {literal}prefix+{/literal}{if Configuration::get('FBPIXEL_ATTRID') == 1}json['id_product_attribute']{elseif Configuration::get('FBPIXEL_ATTRID') == 2}{Tools::getValue('id_product')}+'{Configuration::get('FBPIXEL_SEPSIGN','-')}'+json['id_product_attribute']{else}{Tools::getValue('id_product')}{/if}{literal}+sufix{/literal}, 'product', '{$fbpixel_currency}');
{else}
{literal}fbq('track', 'AddToCart', {content_ids: prefix+{/literal}{if Configuration::get('FBPIXEL_ATTRID') == 1}json['id_product_attribute']{elseif Configuration::get('FBPIXEL_ATTRID') == 2}{Tools::getValue('id_product')}+'{Configuration::get('FBPIXEL_SEPSIGN','-')}'+json['id_product_attribute']{else}{Tools::getValue('id_product')}{/if}{literal}+sufix, content_type: 'product', value: productPagePrice, currency: '{/literal}{$fbpixel_currency}{literal}'});{/literal}
{/if}
});
{/if}
{/if}
}
document.addEventListener("DOMContentLoaded", function(event) {
reinitaddtocart();
});
{else}
{if Configuration::get('FBPIXEL_VCONTENT') == 1}
{if Tools::getValue('id_product','false') != 'false' && $fbpixel_product != NULL}
{assign var=product_price value=$fbpixel_product->getPrice(true, $smarty.const.NULL)}
document.addEventListener("DOMContentLoaded", function(event) {
var json = $.parseJSON($('#product-details').attr('data-product'));
var ids=prefix+{if Configuration::get('FBPIXEL_ATTRID') == 1}json['id_product_attribute']{elseif Configuration::get('FBPIXEL_ATTRID') == 2}{Tools::getValue('id_product')}+'{Configuration::get('FBPIXEL_SEPSIGN','-')}'+json['id_product_attribute']{else}{Tools::getValue('id_product')}{/if}+sufix;
fbq('track', 'ViewContent', {
content_name: '{$fbpixel_product->name|escape:javascript}',
value: {if $FBPIXEL_CONCURR}{Tools::convertPriceFull($product_price|string_format:"%.2f", $currency_from, $currency_to)}{else}{$product_price|string_format:"%.2f"}{/if},
currency: '{$fbpixel_currency}'
});
});
{/if}
{/if}
function reinitaddtocart() {
{if Configuration::get('FBPIXEL_ADDTOCART')==1}
$('.ajax_add_to_cart_button, {Configuration::get('FBPIXEL_ATC_B')}').click(function(){
fbq('track', 'AddToCart');
});
{/if}
}
document.addEventListener("DOMContentLoaded", function(event) {
reinitaddtocart();
});
{/if}
{literal}
</script>
{/literal}
{/if}

View File

@@ -0,0 +1,35 @@
<?php
/*
* 2007-2014 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-2014 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: ../../');

View File

@@ -0,0 +1,35 @@
<?php
/*
* 2007-2014 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-2014 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: ../../');