Add Ceneo Trusted Reviews module with initial implementation

- Created Html helper class for displaying information and translations.
- Added index.php files for various directories to prevent direct access.
- Implemented Polish translations for the module.
- Set up upgrade scripts for future module updates.
- Included Composer autoloading files and configurations.
- Added template files for displaying header and order confirmation scripts.
- Established .htaccess rules for security in vendor directory.
This commit is contained in:
2025-11-14 15:23:09 +01:00
parent 4a1e6a4424
commit 15d1a30e88
39 changed files with 5350 additions and 2 deletions

View File

@@ -11746,8 +11746,8 @@
"pl": { "pl": {
"newsletter_conf.html": { "newsletter_conf.html": {
"type": "-", "type": "-",
"size": 22600, "size": 22635,
"lmtime": 1761133126495, "lmtime": 1761296300786,
"modified": false "modified": false
}, },
"newsletter_conf.txt": { "newsletter_conf.txt": {

View File

@@ -0,0 +1,10 @@
# Changelog #
## 1.0.1 - 2023-08-14 ##
- Analytical events have been extended
- Adjusted the module to prestashop version 8
- Version upgrade
- Improved standards
## Changes in release 1.0.0 ##
- Initial release.

Binary file not shown.

View File

View File

@@ -0,0 +1,284 @@
<?php
/**
* NOTICE OF LICENSE.
* This file is licenced under the Software License Agreement.
* With the purchase or the installation of the software in your application
* you accept the licence agreement.
* You must not modify, adapt or create derivative works of this source code
*
* @author Ceneo.pl
* @copyright Ceneo.pl
* @license LICENSE.txt
* @description Integrates store with Ceneo.pl Trusted Reviews Program
*/
if (!defined('_PS_VERSION_')) {
exit;
}
use CeneoTrustedReviews\Helper\Html;
class Ceneo_TrustedReviews extends Module
{
private $account_guid;
private $days;
private $_html = '';
private $_postErrors = [];
public function __construct()
{
$this->name = 'ceneo_trustedreviews';
$this->tab = 'front_office_features';
$this->version = '1.0.1';
$this->author = 'Ceneo.pl';
$this->need_instance = 0;
$this->is_configurable = 1;
$this->bootstrap = true;
$this->module_key = 'a0faeb050a98036e9cbe1da92c220d4d';
parent::__construct();
$this->displayName = $this->l('Ceneo.pl Trusted Reviews');
$this->description = $this->l('Integrates store with Ceneo.pl Trusted Reviews Program');
$this->confirmUninstall = $this->l('Are You surre You want to uninstall module?');
$this->account_guid = Configuration::get('CENEO_TR_GUID');
$this->days = Configuration::get('CENEO_TR_DAYS');
$this->ps_versions_compliancy = ['min' => '1.7', 'max' => _PS_VERSION_];
$this->ps_version_17 = (version_compare(Tools::substr(_PS_VERSION_, 0, 3), '1.7', '=')) ? true : false;
}
public function install()
{
if (Shop::isFeatureActive()) {
Shop::setContext(Shop::CONTEXT_ALL);
}
if (
!parent::install()
|| !$this->installTabs()
|| !$this->registerHook('displayOrderConfirmation')
|| !$this->registerHook('displayHeader')
) {
return false;
}
Configuration::updateValue('CENEO_TR_GUID', '');
Configuration::updateValue('CENEO_TR_DAYS', '3');
return true;
}
public function installTabs()
{
$moduleName = $this->name;
self::addTab('AdminCeneoClass', 'Ceneo', $moduleName, 'AdminTools', 'settings');
self::addTab('AdminCeneoTrustedreviews', 'Zaufane Opinie', $moduleName, 'AdminCeneoClass', '');
return true;
}
public function uninstallTabs()
{
self::removeTab('AdminCeneoTrustedreviews');
return true;
}
public function uninstall()
{
Configuration::deleteByName('CENEO_TR_GUID');
Configuration::deleteByName('CENEO_TR_DAYS');
if (!parent::uninstall() || !$this->uninstallTabs()) {
return false;
}
return true;
}
private function _postProcess()
{
if (Configuration::updateValue('CENEO_TR_GUID', Tools::getValue('CENEO_TR_GUID'))
&& Configuration::updateValue('CENEO_TR_DAYS', Tools::getValue('CENEO_TR_DAYS'))) {
$this->_html .= $this->displayConfirmation($this->l('Settings updated'));
} else {
$this->_html .= $this->displayError($this->l('Settings failed'));
}
}
private function _postValidation()
{
if (!Tools::getValue('CENEO_TR_GUID') || !Tools::getValue('CENEO_TR_DAYS')) {
$this->_postErrors[] = $this->l('Please provide all data');
}
}
public function getContent()
{
$this->registerHook('displayHeader');
if (Tools::isSubmit('btnSubmit')) {
$this->_postValidation();
if (!count($this->_postErrors)) {
$this->_postProcess();
} else {
foreach ($this->_postErrors as $err) {
$this->_html .= $this->displayError($err);
}
}
}
$html_helper = new Html();
$this->_html .= $html_helper->displayInfoHeader();
$this->_html .= $this->renderForm();
return $this->_html;
}
public function renderForm()
{
$days_range_select = [];
$days_range = range(0, 21);
foreach ($days_range as $d) {
$days_range_select[] = ['id' => $d, 'name' => $d];
}
$fields_form = [
'form' => [
'legend' => [
'title' => $this->l('Ceneo.pl Trusted Reviews configuration'),
'icon' => 'icon-cogs',
],
'input' => [
[
'type' => 'text',
'label' => $this->l('Account GUID'),
'desc' => $this->l('Account GUID given by Ceneo'),
'name' => 'CENEO_TR_GUID',
'size' => 225,
'required' => true,
],
[
'type' => 'select',
'label' => $this->l('Days'),
'desc' => $this->l('Work days to send questionnaire'),
'name' => 'CENEO_TR_DAYS',
'required' => true,
'options' => [
'query' => $days_range_select,
'id' => 'id',
'name' => 'name',
],
],
],
'submit' => [
'title' => $this->l('Save settings'),
],
],
];
$helper = new HelperForm();
$helper->module = $this;
$helper->show_toolbar = false;
$helper->table = $this->table;
$lang = new Language((int) Configuration::get('PS_LANG_DEFAULT'));
$helper->default_form_language = $lang->id;
$helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ?
Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0;
$this->fields_form = [];
$helper->identifier = $this->identifier;
$helper->submit_action = 'btnSubmit';
$helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false) .
'&configure=' . $this->name . '&tab_module=' . $this->tab . '&module_name=' . $this->name;
$helper->token = Tools::getAdminTokenLite('AdminModules');
$helper->tpl_vars = [
'fields_value' => $this->getConfigFieldsValues(),
'languages' => $this->context->controller->getLanguages(),
'id_language' => $this->context->language->id,
];
return $helper->generateForm([$fields_form]);
}
public function getConfigFieldsValues()
{
$return = [];
$return['CENEO_TR_GUID'] = Tools::getValue('CENEO_TR_GUID', Configuration::get('CENEO_TR_GUID'));
$return['CENEO_TR_DAYS'] = Tools::getValue('CENEO_TR_DAYS', Configuration::get('CENEO_TR_DAYS'));
return $return;
}
public function hookDisplayOrderConfirmation($params)
{
if ($this->account_guid && isset($params['order']) && $params['order']) {
$order = $params['order'];
if ($order instanceof Order) {
$client_email = $order->getCustomer()->email;
$products = $order->getProducts();
$products_ids = $this->getProductsIdsString($products);
$currency = new Currency($order->id_currency);
$currencyIsoCode = $currency->iso_code;
$this->smarty->assign([
'guid' => $this->account_guid,
'order_id' => $order->id,
'email' => $client_email,
'products_ids' => $products_ids,
'days' => $this->days,
'products' => $products,
'total_paid' => $order->total_paid,
'currency' => $currencyIsoCode,
]);
return $this->display(__FILE__, 'orderConfirmation.tpl');
}
}
return '';
}
public function hookDisplayHeader($params)
{
$this->smarty->assign([
'guid' => $this->account_guid,
]);
return $this->display(__FILE__, 'displayHeader.tpl');
}
private function getProductsIdsString($products)
{
$ids = [];
if (count($products)) {
foreach ($products as $p) {
$ids[] = $p['id_product'];
}
return '#' . join('#', $ids);
} else {
return '';
}
}
public static function addTab($className, $tabName, $moduleName, $parentClassName, $icon)
{
if ($id_tab = Tab::getIdFromClassName($className)) {
return new Tab($id_tab);
}
$tab = new Tab();
$tab->active = 1;
$tab->class_name = $className;
$tab->name = [];
if (isset($icon)) {
if (!empty($icon)) {
$tab->icon = $icon;
}
}
foreach (Language::getLanguages(true) as $lang) {
$tab->name[$lang['id_lang']] = $tabName;
}
$tab->id_parent = (int) Tab::getIdFromClassName($parentClassName);
$tab->module = $moduleName;
$tab->add();
return $tab;
}
public static function removeTab($className)
{
$id_tab = (int) Tab::getIdFromClassName($className);
$tab = new Tab($id_tab);
if ($tab->name !== '') {
$tab->delete();
}
}
}

View File

@@ -0,0 +1,28 @@
{
"name": "ceneo/ceneotrustedreviews",
"description": "Ceneo Trusted Reviews",
"license": "MIT",
"autoload": {
"psr-4": {
"CeneoTrustedReviews\\": "src/"
}
},
"config": {
"preferred-install": "dist",
"prepend-autoloader": false,
"optimize-autoloader": true
},
"authors": [
{
"name": "Ceneo"
}
],
"type": "prestashop-module",
"author": "Ceneo",
"require-dev": {
"phpstan/phpstan": "^1.10"
},
"scripts": {
"build:prod": "composer install -v --no-dev"
}
}

View File

@@ -0,0 +1,81 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "f3cf98050ea2c4b6276b1cff3f10537e",
"packages": [],
"packages-dev": [
{
"name": "phpstan/phpstan",
"version": "1.10.28",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "e4545b55904ebef470423d3ddddb74fa7325497a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/e4545b55904ebef470423d3ddddb74fa7325497a",
"reference": "e4545b55904ebef470423d3ddddb74fa7325497a",
"shasum": ""
},
"require": {
"php": "^7.2|^8.0"
},
"conflict": {
"phpstan/phpstan-shim": "*"
},
"bin": [
"phpstan",
"phpstan.phar"
],
"type": "library",
"autoload": {
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "PHPStan - PHP Static Analysis Tool",
"keywords": [
"dev",
"static analysis"
],
"support": {
"docs": "https://phpstan.org/user-guide/getting-started",
"forum": "https://github.com/phpstan/phpstan/discussions",
"issues": "https://github.com/phpstan/phpstan/issues",
"security": "https://github.com/phpstan/phpstan/security/policy",
"source": "https://github.com/phpstan/phpstan-src"
},
"funding": [
{
"url": "https://github.com/ondrejmirtes",
"type": "github"
},
{
"url": "https://github.com/phpstan",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan",
"type": "tidelift"
}
],
"time": "2023-08-08T12:33:42+00:00"
}
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"plugin-api-version": "2.3.0"
}

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>ceneo_trustedreviews</name>
<displayName><![CDATA[Ceneo.pl Trusted Reviews]]></displayName>
<version><![CDATA[1.0.1]]></version>
<description><![CDATA[Integrates store with Ceneo.pl Trusted Reviews Program]]></description>
<author><![CDATA[Ceneo.pl]]></author>
<tab><![CDATA[front_office_features]]></tab>
<confirmUninstall><![CDATA[Are you sure you want to uninstall this module?]]></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>ceneo_trustedreviews</name>
<displayName><![CDATA[Ceneo Zaufane Opinie]]></displayName>
<version><![CDATA[1.0.1]]></version>
<description><![CDATA[Integruje sklep z programem Ceneo Zaufane Opinie]]></description>
<author><![CDATA[Ceneo.pl]]></author>
<tab><![CDATA[front_office_features]]></tab>
<confirmUninstall><![CDATA[Jesteś pewien, że chcesz odinstalować moduł?]]></confirmUninstall>
<is_configurable>1</is_configurable>
<need_instance>0</need_instance>
<limited_countries></limited_countries>
</module>

View File

@@ -0,0 +1,31 @@
<?php
/**
* NOTICE OF LICENSE.
* This file is licenced under the Software License Agreement.
* With the purchase or the installation of the software in your application
* you accept the licence agreement.
* You must not modify, adapt or create derivative works of this source code
*
* @author 2022 Ceneo.pl sp. z o.o.
* @copyright Ceneo.pl
* @license LICENSE.txt
* @description Integrates store with Ceneo.pl Trusted Reviews Program
*/
class AdminCeneoTrustedreviewsController extends ModuleAdminController
{
public function init()
{
Tools::redirectAdmin(
Context::getContext()->link->getAdminLink('AdminModules') . '&configure=ceneo_trustedreviews'
);
}
public function __construct()
{
$this->module = 'ceneo_trustedreviews';
$this->bootstrap = true;
$this->context = Context::getContext();
parent::__construct();
}
}

View File

@@ -0,0 +1,19 @@
<?php
/**
* NOTICE OF LICENSE.
* This file is licenced under the Software License Agreement.
* With the purchase or the installation of the software in your application
* you accept the licence agreement.
* You must not modify, adapt or create derivative works of this source code
*
* @author 2022 Ceneo.pl sp. z o.o.
* @copyright Ceneo.pl
* @license LICENSE.txt
*/
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,19 @@
<?php
/**
* NOTICE OF LICENSE.
* This file is licenced under the Software License Agreement.
* With the purchase or the installation of the software in your application
* you accept the licence agreement.
* You must not modify, adapt or create derivative works of this source code
*
* @author 2022 Ceneo.pl sp. z o.o.
* @copyright Ceneo.pl
* @license LICENSE.txt
*/
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,19 @@
<?php
/**
* NOTICE OF LICENSE.
* This file is licenced under the Software License Agreement.
* With the purchase or the installation of the software in your application
* you accept the licence agreement.
* You must not modify, adapt or create derivative works of this source code
*
* @author 2022 Ceneo.pl sp. z o.o.
* @copyright Ceneo.pl
* @license LICENSE.txt
*/
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;

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,54 @@
<?php
/**
* NOTICE OF LICENSE.
* This file is licenced under the Software License Agreement.
* With the purchase or the installation of the software in your application
* you accept the licence agreement.
* You must not modify, adapt or create derivative works of this source code
*
* @author 2022 Ceneo.pl sp. z o.o.
* @copyright Ceneo.pl
* @license LICENSE.txt
* @description Integrates store with Ceneo.pl Trusted Reviews Program
*/
namespace CeneoTrustedReviews\Helper;
if (!defined('_PS_VERSION_')) {
exit;
}
class Html
{
public $_html;
public $module;
public function __construct()
{
$this->module = \Module::getInstanceByName('ceneo_trustedreviews');
}
public function displayInfoHeader()
{
$this->_html = '<div class="alert alert-info"><p>' . $this->l(
'Launching Ceneo Trusted Reviews') . '</p><p>' . $this->l(
'If you already have visible offers, start collecting feedback on your store. Enter your GUID
code, which you will find in ') . '<a target="_blank"
href="https://shops.ceneo.pl/Reviews/TrustedReviews/Information;instruction=true;guid=true#tag=ps">'
. $this->l('Ceneo Panel in the Trusted Reviews tab') . '</a>. ' . $this->l('The service is free.')
. '</p></div>';
return $this->_html;
}
public function l($string, $specific = false, $locale = null)
{
return \Translate::getModuleTranslation(
$this->module,
$string,
($specific) ? $specific : $this->module->name,
null,
false,
$locale
);
}
}

View File

@@ -0,0 +1,19 @@
<?php
/**
* NOTICE OF LICENSE.
* This file is licenced under the Software License Agreement.
* With the purchase or the installation of the software in your application
* you accept the licence agreement.
* You must not modify, adapt or create derivative works of this source code
*
* @author 2022 Ceneo.pl sp. z o.o.
* @copyright Ceneo.pl
* @license LICENSE.txt
*/
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,21 @@
<?php
/**
* NOTICE OF LICENSE.
* This file is licenced under the Software License Agreement.
* With the purchase or the installation of the software in your application
* you accept the licence agreement.
* You must not modify, adapt or create derivative works of this source code
*
* @author 2022 Ceneo.pl sp. z o.o.
* @copyright Ceneo.pl
* @license LICENSE.txt
*/
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,19 @@
<?php
/**
* NOTICE OF LICENSE.
* This file is licenced under the Software License Agreement.
* With the purchase or the installation of the software in your application
* you accept the licence agreement.
* You must not modify, adapt or create derivative works of this source code
*
* @author 2022 Ceneo.pl sp. z o.o.
* @copyright Ceneo.pl
* @license LICENSE.txt
*/
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,20 @@
<?php
global $_MODULE;
$_MODULE = [];
$_MODULE['<{ceneo_trustedreviews}prestashop>ceneo_trustedreviews_6339d8822511ef120fbfcd558cf9aa21'] = 'Ceneo Zaufane Opinie';
$_MODULE['<{ceneo_trustedreviews}prestashop>ceneo_trustedreviews_18a4739630fd21d9aede1a0b29393463'] = 'Integruje sklep z programem Ceneo Zaufane Opinie';
$_MODULE['<{ceneo_trustedreviews}prestashop>ceneo_trustedreviews_aec12a67e583cfa8f2b76060a19a4ed9'] = 'Jesteś pewien, że chcesz odinstalować moduł?';
$_MODULE['<{ceneo_trustedreviews}prestashop>ceneo_trustedreviews_c888438d14855d7d96a2724ee9c306bd'] = 'Ustawienia zauktualizowane';
$_MODULE['<{ceneo_trustedreviews}prestashop>ceneo_trustedreviews_b9284bff13acffdd879ef4ac7fca5234'] = 'Aktualizacja ustawień nie powiodła się';
$_MODULE['<{ceneo_trustedreviews}prestashop>ceneo_trustedreviews_139d725c1d2901c59d9ab0f6d7960cb7'] = 'Uzupełnij wszystkie pola';
$_MODULE['<{ceneo_trustedreviews}prestashop>ceneo_trustedreviews_ad38d90b3097bae7b1d0f2bcf74299b7'] = 'Ceneo Zaufane Opinie - Konfiguracja modułu';
$_MODULE['<{ceneo_trustedreviews}prestashop>ceneo_trustedreviews_ef671c08c94ae8688d3d14e3c98a1a21'] = 'GUID';
$_MODULE['<{ceneo_trustedreviews}prestashop>ceneo_trustedreviews_4ac37865c8dfc850862627c72a3580bd'] = 'GUID nadany przez Ceneo';
$_MODULE['<{ceneo_trustedreviews}prestashop>ceneo_trustedreviews_e807d3ccf8d24c8c1a3d86db5da78da8'] = 'Liczba dni';
$_MODULE['<{ceneo_trustedreviews}prestashop>ceneo_trustedreviews_7d33f70e8c5d7e694cfe82181f46a175'] = 'Liczba dni po których zostanie wysłany e-mail';
$_MODULE['<{ceneo_trustedreviews}prestashop>ceneo_trustedreviews_d4dccb8ca2dac4e53c01bd9954755332'] = 'Zapisz ustawienia';
$_MODULE['<{ceneo_trustedreviews}prestashop>html_ab07e0b92d0b7bb6668e1386ac92eaec'] = 'Uruchomienie Ceneo Trusted Reviews';
$_MODULE['<{ceneo_trustedreviews}prestashop>html_1da3165681136549cbaa42e98f1122a4'] = 'Jeśli masz już widoczne oferty, zacznij zbierać opinie na temat swojego sklepu. Wprowadź swój kod GUID, który znajdziesz w sekcji';
$_MODULE['<{ceneo_trustedreviews}prestashop>html_1387904cfde237b816933691d5e15734'] = 'Panel Ceneo w zakładce Zaufane opinie';
$_MODULE['<{ceneo_trustedreviews}prestashop>html_c4e3e8f4c56f253409ff0b96bf78a2fa'] = 'Usługa jest bezpłatna.';

View File

@@ -0,0 +1,19 @@
<?php
/**
* NOTICE OF LICENSE.
* This file is licenced under the Software License Agreement.
* With the purchase or the installation of the software in your application
* you accept the licence agreement.
* You must not modify, adapt or create derivative works of this source code
*
* @author 2022 Ceneo.pl sp. z o.o.
* @copyright Ceneo.pl
* @license LICENSE.txt
*/
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,20 @@
<?php
/**
* NOTICE OF LICENSE.
* This file is licenced under the Software License Agreement.
* With the purchase or the installation of the software in your application
* you accept the licence agreement.
* You must not modify, adapt or create derivative works of this source code
*
* @author 2022 Ceneo.pl sp. z o.o.
* @copyright Ceneo.pl
* @license LICENSE.txt
*/
if (!defined('_PS_VERSION_')) {
exit;
}
function upgrade_module_1_0_1($module)
{
return $module->registerHook('displayHeader');
}

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 ComposerAutoloaderInit7f2bb9461d46d1297213fea19f9e30a1::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', array_values($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') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $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,9 @@
<?php
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);

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,10 @@
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'CeneoTrustedReviews\\' => array($baseDir . '/src'),
);

View File

@@ -0,0 +1,55 @@
<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit7f2bb9461d46d1297213fea19f9e30a1
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
/**
* @return \Composer\Autoload\ClassLoader
*/
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit7f2bb9461d46d1297213fea19f9e30a1', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit7f2bb9461d46d1297213fea19f9e30a1', '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\ComposerStaticInit7f2bb9461d46d1297213fea19f9e30a1::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}
$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
}
$loader->register(true);
return $loader;
}
}

View File

@@ -0,0 +1,31 @@
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInit7f2bb9461d46d1297213fea19f9e30a1
{
public static $prefixLengthsPsr4 = array (
'C' =>
array (
'CeneoTrustedReviews\\' => 20,
),
);
public static $prefixDirsPsr4 = array (
'CeneoTrustedReviews\\' =>
array (
0 => __DIR__ . '/../..' . '/src',
),
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit7f2bb9461d46d1297213fea19f9e30a1::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit7f2bb9461d46d1297213fea19f9e30a1::$prefixDirsPsr4;
}, null, ClassLoader::class);
}
}

View File

@@ -0,0 +1,11 @@
<?php
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 @@
[]

View File

@@ -0,0 +1,11 @@
<?php
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,19 @@
<?php
/**
* NOTICE OF LICENSE.
* This file is licenced under the Software License Agreement.
* With the purchase or the installation of the software in your application
* you accept the licence agreement.
* You must not modify, adapt or create derivative works of this source code
*
* @author 2022 Ceneo.pl sp. z o.o.
* @copyright Ceneo.pl
* @license LICENSE.txt
*/
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,39 @@
{**
* 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)
*}
{if isset($guid) && $guid !== ''}
{literal}
<script>(function (w, d, s, i, dl){w._ceneo = w._ceneo || function () {
w._ceneo.e = w._ceneo.e || []; w._ceneo.e.push(arguments); };
w._ceneo.e = w._ceneo.e || [];
dl = dl === undefined ? "dataLayer" : dl;
const f = d.getElementsByTagName(s)[0], j = d.createElement(s);
j.defer = true;
j.src = "https://ssl.ceneo.pl/ct/v5/script.js?accountGuid=" + i +
"&t=" + Date.now() + (dl ? "&dl=" + dl : '');
f.parentNode.insertBefore(j, f);
})(window, document, "script", "{/literal}{$guid|escape:'javascript':'UTF-8'}{literal}");
</script>
{/literal}
{/if}

View File

@@ -0,0 +1,19 @@
<?php
/**
* NOTICE OF LICENSE.
* This file is licenced under the Software License Agreement.
* With the purchase or the installation of the software in your application
* you accept the licence agreement.
* You must not modify, adapt or create derivative works of this source code
*
* @author 2022 Ceneo.pl sp. z o.o.
* @copyright Ceneo.pl
* @license LICENSE.txt
*/
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,47 @@
{**
* 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)
*}
{literal}
<script>
_ceneo('transaction', {
client_email: '{/literal}{$email|escape:'javascript':'UTF-8'}{literal}',
order_id: '{/literal}{$order_id|escape:'javascript':'UTF-8'}{literal}',
shop_products: [
{/literal}
{foreach from=$products item=product}
{literal}{{/literal}
id: '{$product['id_product']|escape:'javascript':'UTF-8'}_{$product['product_attribute_id']|escape:'javascript':'UTF-8'}',
price: {$product['unit_price_tax_incl']|escape:'javascript':'UTF-8'},
quantity: {$product['product_quantity']|escape:'javascript':'UTF-8'},
currency: '{$currency|escape:'javascript':'UTF-8'}'
{literal}},{/literal}
{/foreach}
{literal}
],{/literal}
{literal}
work_days_to_send_questionnaire: {/literal}{$days|escape:'javascript':'UTF-8'}{literal},
amount: {/literal}{$total_paid|escape:'javascript':'UTF-8'}{literal}
});
</script>
{/literal}

View File

@@ -0,0 +1,19 @@
<?php
/**
* NOTICE OF LICENSE.
* This file is licenced under the Software License Agreement.
* With the purchase or the installation of the software in your application
* you accept the licence agreement.
* You must not modify, adapt or create derivative works of this source code
*
* @author 2022 Ceneo.pl sp. z o.o.
* @copyright Ceneo.pl
* @license LICENSE.txt
*/
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;