Add initial files and templates for Omnibus EU Free module
- Added yt_logo.png image for branding. - Created index.php for views and templates with license notice and redirection. - Implemented back.js for reload functionality with event listener. - Developed configure.tpl for admin configuration panel with documentation links. - Established products-price-list.tpl for displaying product pricing information. - Created presta_studio_omnibus_price.tpl for displaying price history and discounts. - Added index.php files in various directories for consistent redirection and license notice.
190
modules/omnibuseufree/LICENSE
Normal file
@@ -0,0 +1,190 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Copyright 2023 presta.studio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
22
modules/omnibuseufree/Readme.md
Normal file
@@ -0,0 +1,22 @@
|
||||
# Omnibus for PrestaShop – Free Module
|
||||
|
||||
The price history module for stores based on the PrestaShop platform has been created to meet the requirements of the Omnibus directive in force in the European Union.
|
||||
Once installed, the Omnibus Directive module will record information on each product price change. In addition, our module supports products with combinations and support for multiple currencies. If you have more than one currency configured, then our module will save product prices for each currency available in your store. Based on this, the module provides the consumer with information about the lowest available price for the product.
|
||||
|
||||
The module has been tested in the following versions of PrestaShop:
|
||||
- 1.7.8.10
|
||||
- 8.0.5
|
||||
- 8.1.2
|
||||
|
||||
Online manual
|
||||
=============
|
||||
|
||||
Online manual is available at:
|
||||
- [https://presta.studio/omnibus-for-prestashop-free-module/](https://presta.studio/omnibus-for-prestashop-free-module/) (English)
|
||||
- [https://presta.studio/pl/omnibus-dla-prestashop-darmowy-modul/](https://presta.studio/pl/omnibus-dla-prestashop-darmowy-modul/) (Polish)
|
||||
- [YouTube](https://presta.studio/youtube-omnibus-module)
|
||||
|
||||
Installation
|
||||
=============
|
||||
|
||||
If you intend to install a module on production shop, make sure to download the latest version from our [releases page](https://github.com/dominikadamiak/omnibus-eu/releases), then read the [install guide for users](https://presta.studio/omnibus-for-prestashop-free-module/#installation).
|
||||
14
modules/omnibuseufree/composer.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "prestastudio/omnibus",
|
||||
"description": "Module for Omnibus Directive by the European Union law.",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Omnibus\\Controller\\": "src/controller/",
|
||||
"Omnibus\\Compatibility\\": "src/compatibility/"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"prepend-autoloader": false
|
||||
},
|
||||
"type": "prestashop-module"
|
||||
}
|
||||
11
modules/omnibuseufree/config.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>omnibuseufree</name>
|
||||
<displayName><![CDATA[Omnibus EU]]></displayName>
|
||||
<version><![CDATA[1.0.2]]></version>
|
||||
<description><![CDATA[Module for Omnibus Directive by the European Union law.]]></description>
|
||||
<author><![CDATA[presta.studio]]></author>
|
||||
<tab><![CDATA[pricing_promotion]]></tab>
|
||||
<is_configurable>1</is_configurable>
|
||||
<need_instance>1</need_instance>
|
||||
</module>
|
||||
23
modules/omnibuseufree/config/index.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
7
modules/omnibuseufree/config/routes.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
admin_link_config:
|
||||
path: omnibus/configuration
|
||||
methods: [GET]
|
||||
defaults:
|
||||
_controller: 'Omnibus\Controller\MenuController::menuAction'
|
||||
_legacy_controller: 'OmnibusEuFreeController'
|
||||
_legacy_link: 'OmnibusEuFreeController'
|
||||
48
modules/omnibuseufree/controllers/front/cron.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
|
||||
class OmnibusEuFreeCronModuleFrontController extends ModuleFrontController
|
||||
{
|
||||
/** @var bool If set to true, will be redirected to authentication page */
|
||||
public $auth = false;
|
||||
|
||||
/** @var bool */
|
||||
public $ajax;
|
||||
|
||||
public function display()
|
||||
{
|
||||
$this->ajax = 1;
|
||||
|
||||
if (Configuration::get('OMNIBUSEUFREE_CRON_STATUS', null, null, null, 2) == 1 && Tools::getIsset('token') && Tools::getIsset('type')) {
|
||||
if (Configuration::get('OMNIBUSEUFREE_CRON_TOKEN') == Tools::getValue('token')) {
|
||||
$type = (int) Tools::getValue('type');
|
||||
|
||||
if ($type == 1) {
|
||||
$Omnibus = new OmnibusEuFree;
|
||||
$InsertDataCounter = $Omnibus->insertAllProductsToOmnibusTable();
|
||||
PrestaShopLogger::addLog('[CRON] Omnibus Directive module by presta.studio - Updated price history. Number of products checked: ' . $InsertDataCounter);
|
||||
echo 'Inserted records: ' . $InsertDataCounter;
|
||||
}
|
||||
|
||||
if ($type == 2) {
|
||||
$Omnibus = new OmnibusEuFree;
|
||||
$OldDataCounter = $Omnibus->removeOldDataFromOmnibusTable();
|
||||
PrestaShopLogger::addLog('[CRON] Omnibus Directive module by presta.studio - Deleted old data. Number of records deleted in database: ' . $OldDataCounter);
|
||||
echo 'Deleted old records: ' . $OldDataCounter;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
23
modules/omnibuseufree/controllers/front/index.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
23
modules/omnibuseufree/controllers/index.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
23
modules/omnibuseufree/index.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
BIN
modules/omnibuseufree/logo.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
683
modules/omnibuseufree/omnibuseufree.php
Normal file
@@ -0,0 +1,683 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
use Omnibus\Compatibility\PrestashopCompatibility;
|
||||
|
||||
class OmnibusEuFree extends Module
|
||||
{
|
||||
protected $config_form = false;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'omnibuseufree';
|
||||
$this->tab = 'pricing_promotion';
|
||||
$this->version = '1.0.2';
|
||||
$this->author = 'presta.studio';
|
||||
$this->need_instance = 1;
|
||||
$this->bootstrap = true;
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->l('Omnibus Directive');
|
||||
$this->description = $this->l('This module will help you meet the requirements of the EU Omnibus Directive in your store.');
|
||||
|
||||
$this->confirmUninstall = $this->l('Are you sure you want to uninstall this module? The price history will be deleted.');
|
||||
|
||||
$this->ps_versions_compliancy = array('min' => '1.7', 'max' => _PS_VERSION_);
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
Configuration::updateValue('OMNIBUSEUFREE_INFORMATION_VERSION', 2);
|
||||
Configuration::updateValue('OMNIBUSEUFREE_DISPLAY_PRODUCT_PRICE_BLOCK', 1);
|
||||
Configuration::updateValue('OMNIBUSEUFREE_CRON_STATUS', 2);
|
||||
Configuration::updateValue('OMNIBUSEUFREE_DAYS', 30);
|
||||
|
||||
include(dirname(__FILE__) . '/sql/install.php');
|
||||
|
||||
return parent::install() &&
|
||||
$this->registerHook('header') &&
|
||||
$this->registerHook('displayBackOfficeHeader') &&
|
||||
$this->registerHook('actionProductSave') &&
|
||||
$this->registerHook('actionProductAttributeUpdate') &&
|
||||
$this->registerHook('displayOmnibusEuFree') &&
|
||||
$this->registerHook('displayProductPriceBlock') &&
|
||||
$this->registerHook('displayAdminProductsExtra') &&
|
||||
$this->installTab();
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
Configuration::deleteByName('OMNIBUSEUFREE_INFORMATION_VERSION');
|
||||
Configuration::deleteByName('OMNIBUSEUFREE_DISPLAY_PRODUCT_PRICE_BLOCK');
|
||||
Configuration::deleteByName('OMNIBUSEUFREE_CRON_STATUS');
|
||||
Configuration::deleteByName('OMNIBUSEUFREE_DAYS');
|
||||
|
||||
include(dirname(__FILE__) . '/sql/uninstall.php');
|
||||
|
||||
return parent::uninstall() &&
|
||||
$this->uninstallTab();
|
||||
}
|
||||
|
||||
private function installTab()
|
||||
{
|
||||
$tabId = (int) Tab::getIdFromClassName('OmnibusEuFreeController');
|
||||
if (!$tabId) {
|
||||
$tabId = null;
|
||||
}
|
||||
|
||||
$tab = new Tab($tabId);
|
||||
$tab->active = 1;
|
||||
$tab->class_name = 'OmnibusEuFreeController';
|
||||
$tab->route_name = 'admin_link_config';
|
||||
$tab->icon = 'euro_symbol';
|
||||
$tab->name = array();
|
||||
foreach (Language::getLanguages() as $lang) {
|
||||
$tab->name[$lang['id_lang']] = $this->l('Omnibus Directive');
|
||||
}
|
||||
$tab->id_parent = (int) Tab::getIdFromClassName('IMPROVE');
|
||||
$tab->module = $this->name;
|
||||
|
||||
return $tab->save();
|
||||
}
|
||||
|
||||
private function uninstallTab()
|
||||
{
|
||||
$tabId = (int) Tab::getIdFromClassName('OmnibusEuFreeController');
|
||||
if (!$tabId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$tab = new Tab($tabId);
|
||||
|
||||
return $tab->delete();
|
||||
}
|
||||
|
||||
protected function getLastMinimalPrice($id_product = null, $id_product_attribute = 0, $currency = null)
|
||||
{
|
||||
if (!isset($id_product)) {
|
||||
throw new Exception('Missing parameter: $id_product');
|
||||
}
|
||||
|
||||
if (!isset($currency)) {
|
||||
$defaultCurrency = Currency::getDefaultCurrency();
|
||||
$currency = $defaultCurrency->id;
|
||||
}
|
||||
|
||||
$info_version = Configuration::get('OMNIBUSEUFREE_INFORMATION_VERSION', null, null, null, 2);
|
||||
$NumberOfDays = (int) Configuration::get('OMNIBUSEUFREE_DAYS', null, null, null, 30);
|
||||
|
||||
$date = new DateTime();
|
||||
$date->modify('-' . $NumberOfDays . ' days');
|
||||
$CutOffDate = $date->format('Y-m-d');
|
||||
|
||||
$sql = new DbQuery();
|
||||
$sql->select('price');
|
||||
$sql->from('omnibus_eu_free');
|
||||
$sql->where('id_product = ' . (int) $id_product);
|
||||
$sql->where('id_product_attribute = ' . (int) $id_product_attribute);
|
||||
$sql->where('id_currency = ' . (int) $currency);
|
||||
$sql->where('date_add >= "'.$CutOffDate.' 00:00:00"');
|
||||
|
||||
if ($info_version == 2) {
|
||||
$sql->where('is_last = 0');
|
||||
}
|
||||
|
||||
$sql->orderBy('price ASC');
|
||||
$sql->limit(1);
|
||||
$sqlResult = Db::getInstance()->executeS($sql);
|
||||
|
||||
return (!empty($sqlResult)) ? $sqlResult[0] : array();
|
||||
}
|
||||
|
||||
public function hookDisplayOmnibusEuFree($params)
|
||||
{
|
||||
$currency = $this->context->currency;
|
||||
$lastMinimalPrice = $this->getLastMinimalPrice($params['product']['id_product'], $params['product']['id_product_attribute'], $currency->id);
|
||||
|
||||
if (!empty($lastMinimalPrice)) {
|
||||
$minimalPrice = PrestashopCompatibility::formatPrice(_PS_VERSION_, $lastMinimalPrice['price'], $currency);
|
||||
}
|
||||
else {
|
||||
$minimalPrice = null;
|
||||
}
|
||||
|
||||
$this->context->smarty->assign([
|
||||
'OmnibuseufreeInfoVersion' => (int) Configuration::get('OMNIBUSEUFREE_INFORMATION_VERSION', null, null, null, 2),
|
||||
'OmnibuseufreeProductPriceMin' => $minimalPrice,
|
||||
'OmnibuseufreeProductPriceCurrent' => $params['product']['price'],
|
||||
'OmnibuseufreeProductDiscount' => (bool) $params['product']['has_discount'],
|
||||
'OmnibuseufreeNumberOfDays' => (int) Configuration::get('OMNIBUSEUFREE_DAYS', null, null, null, 30),
|
||||
]);
|
||||
|
||||
return $this->display(__FILE__, '/views/templates/hook/presta_studio_omnibus_price.tpl');
|
||||
}
|
||||
|
||||
public function hookDisplayProductPriceBlock($params)
|
||||
{
|
||||
return ($params['type'] == 'after_price' && Configuration::get('OMNIBUSEUFREE_DISPLAY_PRODUCT_PRICE_BLOCK') == 1) ? $this->hookDisplayOmnibusEuFree($params) : '';
|
||||
}
|
||||
|
||||
public function hookDisplayAdminProductsExtra($params)
|
||||
{
|
||||
$OmnibusData = array();
|
||||
|
||||
foreach ($this->getOmnibusData($params['id_product']) as $rowId => $rowValue) {
|
||||
$OmnibusData[$rowId]['price_locale'] = '';
|
||||
$OmnibusData[$rowId]['currency_iso_code'] = '';
|
||||
$OmnibusData[$rowId]['name'] = '';
|
||||
$OmnibusData[$rowId]['is_last_icon'] = '';
|
||||
|
||||
foreach ($rowValue as $key => $value) {
|
||||
if (isset($OmnibusData[$rowId]['price']) && $key == 'id_currency') {
|
||||
$currency = Currency::getCurrencyInstance((int) $value);
|
||||
$OmnibusData[$rowId]['price_locale'] = PrestashopCompatibility::formatPrice(_PS_VERSION_, $OmnibusData[$rowId]['price'], $currency);
|
||||
$OmnibusData[$rowId]['currency_iso_code'] = $currency->iso_code;
|
||||
}
|
||||
elseif ($key == 'id_product_attribute') {
|
||||
$product = new Product($params['id_product']);
|
||||
$OmnibusData[$rowId]['name'] = $product->getProductName($params['id_product'], $value);
|
||||
($product->hasCombinations() && $value == 0) ? $OmnibusData[$rowId]['name'] .= ' ' . $this->l('(default combination)') : '';
|
||||
}
|
||||
elseif ($key == 'is_last' && $value == 1) {
|
||||
$OmnibusData[$rowId]['is_last_icon'] = '<span class="material-icons text-success">done</span>';
|
||||
}
|
||||
|
||||
$OmnibusData[$rowId][$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$this->context->smarty->assign([
|
||||
'OmnibuseufreeData' => $OmnibusData
|
||||
]);
|
||||
|
||||
return $this->display(__FILE__, '/views/templates/admin/products-price-list.tpl');
|
||||
}
|
||||
|
||||
public function hookHeader()
|
||||
{
|
||||
$this->context->controller->addCSS($this->_path . '/views/css/omnibuseufree-presta-studio.css');
|
||||
}
|
||||
|
||||
public function hookDisplayBackOfficeHeader()
|
||||
{
|
||||
$this->context->controller->addJS($this->_path . 'views/js/back.js');
|
||||
$this->context->controller->addCSS($this->_path . 'views/css/back.css');
|
||||
}
|
||||
|
||||
public function hookActionProductSave($hook_params)
|
||||
{
|
||||
if (Module::isEnabled('omnibuseufree')) {
|
||||
Product::flushPriceCache();
|
||||
|
||||
$this->addProductPriceWithCombinations($hook_params['id_product']);
|
||||
$this->addProductPrice($hook_params['id_product']);
|
||||
}
|
||||
}
|
||||
|
||||
public function hookActionProductAttributeUpdate()
|
||||
{
|
||||
if (Module::isEnabled('omnibuseufree')) {
|
||||
$id_product = (int) Tools::getValue('id_product');
|
||||
Product::flushPriceCache();
|
||||
|
||||
$this->addProductPriceWithCombinations($id_product);
|
||||
$this->addProductPrice($id_product);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the configuration form
|
||||
*/
|
||||
public function getContent()
|
||||
{
|
||||
$confirmation = '';
|
||||
if (((bool) Tools::isSubmit('submitOmnibusEuFreeModule')) == true) {
|
||||
$confirmation = $this->postProcess();
|
||||
}
|
||||
|
||||
$token = Configuration::get('OMNIBUSEUFREE_CRON_TOKEN', null, null, null, 'error');
|
||||
|
||||
$this->context->smarty->assign([
|
||||
'module_dir' => $this->_path,
|
||||
'lang' => $this->context->language->iso_code,
|
||||
'update_prices' => Context::getContext()->link->getModuleLink('omnibuseufree', 'cron', array('type' => 1, 'token' => $token)),
|
||||
'delete_outdated_data' => Context::getContext()->link->getModuleLink('omnibuseufree', 'cron', array('type' => 2, 'token' => $token)),
|
||||
'cron_status' => Configuration::get('OMNIBUSEUFREE_CRON_STATUS', null, null, null, 2)
|
||||
]);
|
||||
|
||||
$output = $this->context->smarty->fetch($this->local_path . 'views/templates/admin/configure.tpl');
|
||||
|
||||
return $confirmation . $output . $this->renderForm();
|
||||
}
|
||||
|
||||
protected function renderForm()
|
||||
{
|
||||
$helper = new HelperForm();
|
||||
|
||||
$helper->show_toolbar = false;
|
||||
$helper->table = $this->table;
|
||||
$helper->module = $this;
|
||||
$helper->default_form_language = $this->context->language->id;
|
||||
$helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG', 0);
|
||||
|
||||
$helper->identifier = $this->identifier;
|
||||
$helper->submit_action = 'submitOmnibusEuFreeModule';
|
||||
$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 = array(
|
||||
'fields_value' => $this->getConfigFormValues(),
|
||||
'languages' => $this->context->controller->getLanguages(),
|
||||
'id_language' => $this->context->language->id,
|
||||
);
|
||||
|
||||
return $helper->generateForm(array($this->getConfigForm()));
|
||||
}
|
||||
|
||||
protected function getConfigForm()
|
||||
{
|
||||
$NumberOfDays = (int) Configuration::get('OMNIBUSEUFREE_DAYS', null, null, null, 30);
|
||||
|
||||
return array(
|
||||
'form' => array(
|
||||
'legend' => array(
|
||||
'title' => $this->l('Settings'),
|
||||
'icon' => 'icon-cogs',
|
||||
),
|
||||
'input' => array(
|
||||
array(
|
||||
'type' => 'switch',
|
||||
'label' => $this->l('Delete outdated data'),
|
||||
'name' => 'OMNIBUSEUFREE_OLD_DATA',
|
||||
'is_bool' => true,
|
||||
'values' => array(
|
||||
array(
|
||||
'id' => 'active_on',
|
||||
'value' => true,
|
||||
'label' => $this->l('Enabled')
|
||||
),
|
||||
array(
|
||||
'id' => 'active_off',
|
||||
'value' => false,
|
||||
'label' => $this->l('Disabled')
|
||||
)
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'switch',
|
||||
'label' => $this->l('Update prices'),
|
||||
'name' => 'OMNIBUSEUFREE_UPDATE_DATABASE_PRICE',
|
||||
'is_bool' => true,
|
||||
'values' => array(
|
||||
array(
|
||||
'id' => 'active_on',
|
||||
'value' => true,
|
||||
'label' => $this->l('Enabled')
|
||||
),
|
||||
array(
|
||||
'id' => 'active_off',
|
||||
'value' => false,
|
||||
'label' => $this->l('Disabled')
|
||||
)
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'select',
|
||||
'label' => $this->l('Version:'),
|
||||
'name' => 'OMNIBUSEUFREE_INFORMATION_VERSION',
|
||||
'class' => 'omnibus-select-version',
|
||||
'required' => true,
|
||||
'options' => array(
|
||||
'query' => array(
|
||||
array(
|
||||
'id_option' => 1,
|
||||
'name' => sprintf($this->l('Lowest price in %d days'),$NumberOfDays)
|
||||
),
|
||||
array(
|
||||
'id_option' => 2,
|
||||
'name' => sprintf($this->l('Lowest price in %d days before discount'),$NumberOfDays)
|
||||
),
|
||||
),
|
||||
'id' => 'id_option',
|
||||
'name' => 'name'
|
||||
)
|
||||
),
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Number of days'),
|
||||
'name' => 'OMNIBUSEUFREE_DAYS',
|
||||
'class' => 'omnibus-input-days',
|
||||
'maxlength' => '3',
|
||||
'required' => true
|
||||
),
|
||||
array(
|
||||
'type' => 'switch',
|
||||
'label' => $this->l('Display on product page'),
|
||||
'name' => 'OMNIBUSEUFREE_DISPLAY_PRODUCT_PRICE_BLOCK',
|
||||
'is_bool' => false,
|
||||
'desc' => $this->l('Hook: ProductPriceBlock type: after_price'),
|
||||
'values' => array(
|
||||
array(
|
||||
'id' => 'active_on',
|
||||
'value' => 1,
|
||||
'label' => $this->l('Enabled')
|
||||
),
|
||||
array(
|
||||
'id' => 'active_off',
|
||||
'value' => 2,
|
||||
'label' => $this->l('Disabled')
|
||||
)
|
||||
),
|
||||
),
|
||||
array(
|
||||
'type' => 'switch',
|
||||
'label' => $this->l('CRON'),
|
||||
'name' => 'OMNIBUSEUFREE_CRON_STATUS',
|
||||
'is_bool' => false,
|
||||
'desc' => $this->l('A new token will be generated if you change the CRON status'),
|
||||
'values' => array(
|
||||
array(
|
||||
'id' => 'active_on',
|
||||
'value' => 1,
|
||||
'label' => $this->l('Enabled')
|
||||
),
|
||||
array(
|
||||
'id' => 'active_off',
|
||||
'value' => 2,
|
||||
'label' => $this->l('Disabled')
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
'submit' => array(
|
||||
'title' => $this->l('Save'),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set values for the inputs.
|
||||
*
|
||||
* OMNIBUSEUFREE_CRON_STATUS since v1.0.2
|
||||
* OMNIBUSEUFREE_DAYS since v1.0.2
|
||||
*
|
||||
*/
|
||||
protected function getConfigFormValues()
|
||||
{
|
||||
return array(
|
||||
'OMNIBUSEUFREE_OLD_DATA' => false,
|
||||
'OMNIBUSEUFREE_UPDATE_DATABASE_PRICE' => false,
|
||||
'OMNIBUSEUFREE_INFORMATION_VERSION' => Configuration::get('OMNIBUSEUFREE_INFORMATION_VERSION', null, null, null, 2),
|
||||
'OMNIBUSEUFREE_DISPLAY_PRODUCT_PRICE_BLOCK' => Configuration::get('OMNIBUSEUFREE_DISPLAY_PRODUCT_PRICE_BLOCK', null, null, null, 1),
|
||||
'OMNIBUSEUFREE_CRON_STATUS' => Configuration::get('OMNIBUSEUFREE_CRON_STATUS', null, null, null, 2),
|
||||
'OMNIBUSEUFREE_DAYS' => Configuration::get('OMNIBUSEUFREE_DAYS', null, null, null, 30)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save form data.
|
||||
*/
|
||||
protected function postProcess()
|
||||
{
|
||||
if (Configuration::get('OMNIBUSEUFREE_CRON_STATUS', null, null, null, 2) != Tools::getValue('OMNIBUSEUFREE_CRON_STATUS')) {
|
||||
Configuration::updateValue('OMNIBUSEUFREE_CRON_TOKEN', Tools::hash(Tools::passwdGen(16)));
|
||||
}
|
||||
|
||||
Configuration::updateValue('OMNIBUSEUFREE_INFORMATION_VERSION', (int) Tools::getValue('OMNIBUSEUFREE_INFORMATION_VERSION'));
|
||||
Configuration::updateValue('OMNIBUSEUFREE_DISPLAY_PRODUCT_PRICE_BLOCK', (int) Tools::getValue('OMNIBUSEUFREE_DISPLAY_PRODUCT_PRICE_BLOCK'));
|
||||
Configuration::updateValue('OMNIBUSEUFREE_CRON_STATUS', (int) Tools::getValue('OMNIBUSEUFREE_CRON_STATUS'));
|
||||
Configuration::updateValue('OMNIBUSEUFREE_DAYS', (int) Tools::getValue('OMNIBUSEUFREE_DAYS'));
|
||||
|
||||
$confirmation = $this->l('The settings have been updated.');
|
||||
|
||||
if (Tools::getValue('OMNIBUSEUFREE_OLD_DATA')) {
|
||||
$OldDataCounter = $this->removeOldDataFromOmnibusTable();
|
||||
PrestaShopLogger::addLog('Omnibus Directive module by presta.studio - Deleted old data. Number of records deleted in database: ' . $OldDataCounter);
|
||||
$confirmation .= '<br>' . $this->l('Deleted old data. Number of records deleted in database: ') . $OldDataCounter;
|
||||
}
|
||||
|
||||
if (Tools::getValue('OMNIBUSEUFREE_UPDATE_DATABASE_PRICE')) {
|
||||
$InsertDataCounter = $this->insertAllProductsToOmnibusTable();
|
||||
PrestaShopLogger::addLog('Omnibus Directive module by presta.studio - Updated price history. Number of products checked: ' . $InsertDataCounter);
|
||||
$confirmation .= '<br>' . $this->l('Updated price history. Number of products checked: ') . $InsertDataCounter;
|
||||
}
|
||||
|
||||
return $this->displayConfirmation($confirmation);
|
||||
}
|
||||
|
||||
protected function checkCurrencyConversionRate($id_product = null, $id_product_attribute = 0)
|
||||
{
|
||||
if (!isset($id_product)) {
|
||||
throw new Exception('Missing parameter: $id_product');
|
||||
}
|
||||
|
||||
$sql = new DbQuery();
|
||||
$sql->select('id_currency, currency_conversion_rate');
|
||||
$sql->from('omnibus_eu_free');
|
||||
$sql->where('id_product = ' . (int) $id_product);
|
||||
$sql->where('id_product_attribute = ' . (int) $id_product_attribute);
|
||||
$sql->where('is_last = 1');
|
||||
$SQLResult = Db::getInstance()->executeS($sql);
|
||||
|
||||
$ToChange = 0;
|
||||
$OmnibusCurrencies = array();
|
||||
|
||||
foreach ($SQLResult as $row) {
|
||||
$OmnibusCurrencies[$row['id_currency']] = $row['currency_conversion_rate'];
|
||||
}
|
||||
|
||||
if (!empty($OmnibusCurrencies)) {
|
||||
$currencies = Currency::getCurrencies();
|
||||
$AvailableCurrencies = array();
|
||||
|
||||
foreach ($currencies as $currency) {
|
||||
$AvailableCurrencies[$currency['id_currency']] = $currency['conversion_rate'];
|
||||
}
|
||||
|
||||
foreach ($AvailableCurrencies as $CurrencyKey => $CurrencyValue) {
|
||||
if (!isset($OmnibusCurrencies[$CurrencyKey]) || $CurrencyValue != $OmnibusCurrencies[$CurrencyKey]) {
|
||||
$ToChange++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$ToChange++;
|
||||
}
|
||||
|
||||
return $ToChange == 0 ? false : true;
|
||||
}
|
||||
|
||||
protected function addProductPrice($id_product = null)
|
||||
{
|
||||
if (!isset($id_product)) {
|
||||
throw new Exception('Missing parameter: $id_product');
|
||||
}
|
||||
|
||||
$product = new Product($id_product);
|
||||
$product_price = $product->getPrice();
|
||||
|
||||
if($product_price != 0){
|
||||
$omnibus_price = array();
|
||||
$omnibus_price = $this->getLastPrice($id_product, 0);
|
||||
|
||||
$check_currency = $this->checkCurrencyConversionRate($id_product, 0);
|
||||
|
||||
if (empty($omnibus_price) || $product_price != $omnibus_price[0]['price'] || (bool) $check_currency == true) {
|
||||
$this->clearLastPrice($id_product);
|
||||
$currencies = Currency::getCurrencies();
|
||||
$defaultCurrency = Currency::getDefaultCurrency();
|
||||
|
||||
foreach ($currencies as $currency) {
|
||||
if ($currency['id_currency'] == $defaultCurrency->id) {
|
||||
$isDefaultCurrency = 1;
|
||||
$product_price_currency = $product_price;
|
||||
}
|
||||
else {
|
||||
$isDefaultCurrency = 0;
|
||||
$product_price_currency = Tools::convertPrice($product_price, $currency);
|
||||
}
|
||||
|
||||
$this->insertToOmnibusTable($id_product, 0, $product_price_currency, $currency['id_currency'], $isDefaultCurrency, $currency['conversion_rate']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function addProductPriceWithCombinations($id_product = null)
|
||||
{
|
||||
if (!isset($id_product)) {
|
||||
throw new Exception('Missing parameter: $id_product');
|
||||
}
|
||||
|
||||
$product = new Product($id_product);
|
||||
$product_combinations = $product->getAttributeCombinations();
|
||||
|
||||
if (!empty($product_combinations)) {
|
||||
$currencies = Currency::getCurrencies(); unset( $currencies[0] ); unset( $currencies[2] );
|
||||
$defaultCurrency = Currency::getDefaultCurrency();
|
||||
|
||||
foreach ($product_combinations as $combination) {
|
||||
$product_price = $product->getPrice(true, $combination['id_product_attribute'] );
|
||||
|
||||
if($product_price != 0){
|
||||
$omnibus_price = array();
|
||||
$omnibus_price = $this->getLastPrice($id_product, $combination['id_product_attribute']);
|
||||
|
||||
$check_currency = $this->checkCurrencyConversionRate($id_product, $combination['id_product_attribute']);
|
||||
|
||||
if (empty($omnibus_price) || $product_price != $omnibus_price[0]['price'] || (bool) $check_currency == true) {
|
||||
$this->clearLastPrice($id_product, $combination['id_product_attribute']);
|
||||
|
||||
foreach ($currencies as $currency) {
|
||||
if ($currency['id_currency'] == $defaultCurrency->id) {
|
||||
$isDefaultCurrency = 1;
|
||||
$product_price_currency = $product_price;
|
||||
}
|
||||
else {
|
||||
$isDefaultCurrency = 0;
|
||||
$product_price_currency = Tools::convertPrice($product_price, $currency);
|
||||
}
|
||||
|
||||
$this->insertToOmnibusTable($id_product, $combination['id_product_attribute'], $product_price_currency, $currency['id_currency'], $isDefaultCurrency, $currency['conversion_rate']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function insertToOmnibusTable($id_product = 0, $id_product_attribute = 0, $product_price = 0, $currency = 0, $isDefaultCurrency = 0, $CurrencyConversionRate = 0)
|
||||
{
|
||||
$result = Db::getInstance()->insert('omnibus_eu_free', [
|
||||
'id_product' => (int) $id_product,
|
||||
'id_product_attribute' => (int) $id_product_attribute,
|
||||
'price' => pSQL($product_price),
|
||||
'id_currency' => (int) $currency,
|
||||
'is_default_currency' => (int) $isDefaultCurrency,
|
||||
'is_last' => 1,
|
||||
'currency_conversion_rate' => pSQL($CurrencyConversionRate)
|
||||
]);
|
||||
}
|
||||
|
||||
protected function getLastPrice($id_product = 0, $id_product_attribute = 0)
|
||||
{
|
||||
$sql = new DbQuery();
|
||||
$sql->select('price');
|
||||
$sql->from('omnibus_eu_free');
|
||||
$sql->where('id_product = ' . (int) $id_product);
|
||||
$sql->where('id_product_attribute = ' . (int) $id_product_attribute);
|
||||
$sql->where('is_last = 1');
|
||||
$sql->where('is_default_currency = 1');
|
||||
$sql->limit(1);
|
||||
|
||||
return Db::getInstance()->executeS($sql);
|
||||
}
|
||||
|
||||
protected function getOmnibusData($id_product = null)
|
||||
{
|
||||
if (!isset($id_product)) {
|
||||
throw new Exception('Missing parameter: $id_product');
|
||||
}
|
||||
|
||||
$sql = new DbQuery();
|
||||
$sql->select('*');
|
||||
$sql->from('omnibus_eu_free');
|
||||
$sql->where('id_product = ' . (int) $id_product);
|
||||
$sql->orderBy('is_default_currency DESC');
|
||||
$sql->orderBy('id_currency ASC');
|
||||
$sql->orderBy('id_product_attribute ASC');
|
||||
$sql->orderBy('id_omnibuseufree DESC');
|
||||
|
||||
return Db::getInstance()->executeS($sql);
|
||||
}
|
||||
|
||||
protected function clearLastPrice($id_product = 0, $id_product_attribute = 0)
|
||||
{
|
||||
$result = Db::getInstance()->update('omnibus_eu_free', array(
|
||||
'is_last' => 0,
|
||||
), 'id_product = ' . (int) $id_product . ' AND id_product_attribute = ' . (int) $id_product_attribute);
|
||||
}
|
||||
|
||||
public function insertAllProductsToOmnibusTable()
|
||||
{
|
||||
$counter = 0;
|
||||
$ProductClass = new Product();
|
||||
$ProductClass->flushPriceCache();
|
||||
$products = $ProductClass->getProducts($this->context->language->id, 0, 0, 'id_product', 'ASC');
|
||||
|
||||
foreach ($products as $product) {
|
||||
$this->addProductPriceWithCombinations($product['id_product']);
|
||||
$this->addProductPrice($product['id_product']);
|
||||
$counter++;
|
||||
}
|
||||
|
||||
return $counter;
|
||||
}
|
||||
|
||||
public function removeOldDataFromOmnibusTable()
|
||||
{
|
||||
$NumberOfDays = (int) Configuration::get('OMNIBUSEUFREE_DAYS', null, null, null, 30);
|
||||
|
||||
$date = new DateTime();
|
||||
$date->modify('-' . $NumberOfDays . ' days');
|
||||
$CutOffDate = $date->format('U');
|
||||
$counter = 0;
|
||||
|
||||
$sql = new DbQuery();
|
||||
$sql->select('id_omnibuseufree, date_add');
|
||||
$sql->from('omnibus_eu_free');
|
||||
$sql->where('is_last = 0');
|
||||
$result = Db::getInstance()->executeS($sql);
|
||||
|
||||
foreach ($result as $row) {
|
||||
$date = new DateTime($row['date_add']);
|
||||
$DatabaseDate = $date->format('U');
|
||||
|
||||
if ($DatabaseDate < $CutOffDate) {
|
||||
Db::getInstance()->delete('omnibus_eu_free', '`id_omnibuseufree` = ' . (int) $row['id_omnibuseufree']);
|
||||
$counter++;
|
||||
}
|
||||
}
|
||||
|
||||
return $counter;
|
||||
}
|
||||
}
|
||||
23
modules/omnibuseufree/sql/index.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
39
modules/omnibuseufree/sql/install.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
|
||||
$sql = array();
|
||||
|
||||
$sql[] = 'CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'omnibus_eu_free` (
|
||||
`id_omnibuseufree` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) UNSIGNED NOT NULL,
|
||||
`id_product_attribute` int(11) UNSIGNED NOT NULL,
|
||||
`price` decimal(20,6) NOT NULL DEFAULT 0.000000,
|
||||
`id_currency` int(11) NOT NULL DEFAULT 0,
|
||||
`is_default_currency` int(11) NOT NULL DEFAULT 0,
|
||||
`is_last` int(11) NOT NULL DEFAULT 0,
|
||||
`currency_conversion_rate` decimal(13,6) NOT NULL DEFAULT 0.000000,
|
||||
`date_add` datetime NOT NULL DEFAULT current_timestamp(),
|
||||
PRIMARY KEY (`id_omnibuseufree`)
|
||||
) ENGINE=' . _MYSQL_ENGINE_ . ' DEFAULT CHARSET=utf8;';
|
||||
|
||||
$sql[] = 'ALTER TABLE `' . _DB_PREFIX_ . 'omnibus_eu_free`
|
||||
ADD KEY `id_product` (`id_product`),
|
||||
ADD KEY `id_product_attribute` (`id_product_attribute`);';
|
||||
|
||||
foreach ($sql as $query) {
|
||||
if (Db::getInstance()->execute($query) == false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
24
modules/omnibuseufree/sql/uninstall.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
|
||||
$sql = array();
|
||||
|
||||
$sql[] = 'DROP TABLE IF EXISTS `' . _DB_PREFIX_ . 'omnibus_eu_free`';
|
||||
|
||||
foreach ($sql as $query) {
|
||||
if (Db::getInstance()->execute($query) == false) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Omnibus\Compatibility;
|
||||
|
||||
use Tools;
|
||||
use Context;
|
||||
|
||||
class PrestashopCompatibility
|
||||
{
|
||||
public static function formatPrice($PSversion, $price, $currency)
|
||||
{
|
||||
if (version_compare($PSversion, '1.7.7') >= 0) {
|
||||
return Tools::getContextLocale(Context::getContext())->formatPrice($price, $currency->iso_code);
|
||||
}
|
||||
else {
|
||||
return Tools::displayPrice($price, $currency->id);
|
||||
}
|
||||
}
|
||||
}
|
||||
23
modules/omnibuseufree/src/compatibility/index.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
28
modules/omnibuseufree/src/controller/MenuController.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
|
||||
namespace Omnibus\Controller;
|
||||
|
||||
use PrestaShopBundle\Controller\Admin\FrameworkBundleAdminController;
|
||||
use Tools;
|
||||
use Context;
|
||||
|
||||
class MenuController extends FrameworkBundleAdminController
|
||||
{
|
||||
public function menuAction()
|
||||
{
|
||||
Tools::redirectAdmin(Context::getContext()->link->getAdminLink('AdminModules').'&configure=omnibuseufree');
|
||||
}
|
||||
}
|
||||
23
modules/omnibuseufree/src/controller/index.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
23
modules/omnibuseufree/src/index.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
23
modules/omnibuseufree/translations/index.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
44
modules/omnibuseufree/translations/pl.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
global $_MODULE;
|
||||
$_MODULE = array();
|
||||
$_MODULE['<{omnibuseufree}prestashop>omnibuseufree_1f02c2fa9d484f44c5da7f380dff8c60'] = 'Dyrektywa Omnibus';
|
||||
$_MODULE['<{omnibuseufree}prestashop>omnibuseufree_a79fe40b2123c032e9a814001fe222bd'] = 'Ten moduł pomoże Ci spełnić wymagania Europejskiej Dyrektywy Omnibus.';
|
||||
$_MODULE['<{omnibuseufree}prestashop>omnibuseufree_28819824712520e55d7c4a41e7b4a473'] = 'Czy na pewno chcesz odinstalować ten moduł? Historia cen zostanie usunięta.';
|
||||
$_MODULE['<{omnibuseufree}prestashop>omnibuseufree_292798f2e60c44bdb0f8574e23ef93c9'] = '(domyślna kombinacja)';
|
||||
$_MODULE['<{omnibuseufree}prestashop>omnibuseufree_f4f70727dc34561dfde1a3c529b6205c'] = 'Ustawienia';
|
||||
$_MODULE['<{omnibuseufree}prestashop>omnibuseufree_f7e5ee1fbf4617a1f7392a78df1c7f51'] = 'Usuń nieaktualne dane';
|
||||
$_MODULE['<{omnibuseufree}prestashop>omnibuseufree_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Włączony';
|
||||
$_MODULE['<{omnibuseufree}prestashop>omnibuseufree_b9f5c797ebbf55adccdd8539a65a0241'] = 'Wyłączony';
|
||||
$_MODULE['<{omnibuseufree}prestashop>omnibuseufree_bb2a88ee038dcf4ee8c5d3c2c0c9932a'] = 'Zaktualizuj ceny';
|
||||
$_MODULE['<{omnibuseufree}prestashop>omnibuseufree_9d290d3434589e33be3d2cad4f8323ec'] = 'Wersja';
|
||||
$_MODULE['<{omnibuseufree}prestashop>omnibuseufree_7cb3887eb464b7ec919eaab83d2b2bf8'] = 'Najniższa cena w ciągu %d dni';
|
||||
$_MODULE['<{omnibuseufree}prestashop>omnibuseufree_8f5d023ee6465215923e8ff47460c16c'] = 'Najniższa cena w ciągu %d dni przed obniżką';
|
||||
$_MODULE['<{omnibuseufree}prestashop>omnibuseufree_58fd2b2308056ad80255a322b305742b'] = 'Ilość dni';
|
||||
$_MODULE['<{omnibuseufree}prestashop>omnibuseufree_05bc01ac9b2ddb3ca06251211ba7ffba'] = 'Wyświetlaj na stronie produktu';
|
||||
$_MODULE['<{omnibuseufree}prestashop>omnibuseufree_9153c0b134e442737ebcda88012a29b8'] = 'Hook: ProductPriceBlock type: after_price';
|
||||
$_MODULE['<{omnibuseufree}prestashop>omnibuseufree_c16afd878f99cc59851c860ea909059d'] = 'CRON';
|
||||
$_MODULE['<{omnibuseufree}prestashop>omnibuseufree_08baf2fc3ce7096a98a262d45bd2eb6e'] = 'Nowy token zostanie wygenerowany przy każdym włączeniu CRON';
|
||||
$_MODULE['<{omnibuseufree}prestashop>omnibuseufree_c9cc8cce247e49bae79f15173ce97354'] = 'Zapisz';
|
||||
$_MODULE['<{omnibuseufree}prestashop>omnibuseufree_efc226b17e0532afff43be870bff0de7'] = 'Ustawienia zostały zapisane';
|
||||
$_MODULE['<{omnibuseufree}prestashop>omnibuseufree_f1bf37ab201597afc8a9c65bcbec15f1'] = 'Usunięto nieaktualne dane. Ilość usuniętych rekordów w bazie danych: ';
|
||||
$_MODULE['<{omnibuseufree}prestashop>omnibuseufree_cb9221743dea1428e7fdc4c7c9b499cd'] = 'Zaktualizowano historię cen. Ilość sprawdzonych produktów: ';
|
||||
$_MODULE['<{omnibuseufree}prestashop>configure_5b6cf869265c13af8566f192b4ab3d2a'] = 'Dokumentacja';
|
||||
$_MODULE['<{omnibuseufree}prestashop>configure_7c9a200fb690d89b9ab34f521db396fc'] = 'Instalacja i konfiguracja modułu';
|
||||
$_MODULE['<{omnibuseufree}prestashop>configure_78463a384a5aa4fad5fa73e2f506ecfc'] = 'English';
|
||||
$_MODULE['<{omnibuseufree}prestashop>configure_c730389bc8d99e59c867766babdd48b5'] = 'Polski';
|
||||
$_MODULE['<{omnibuseufree}prestashop>configure_738bc5faa88e6b0fa0e7e3385d7e4ee3'] = 'Obserwuj nas';
|
||||
$_MODULE['<{omnibuseufree}prestashop>configure_c16afd878f99cc59851c860ea909059d'] = 'CRON';
|
||||
$_MODULE['<{omnibuseufree}prestashop>configure_bb2a88ee038dcf4ee8c5d3c2c0c9932a'] = 'Zaktualizuj ceny';
|
||||
$_MODULE['<{omnibuseufree}prestashop>configure_7ba8e8ff7f4d3a79fb20609888b2bf3b'] = 'CRON jest wyłączony';
|
||||
$_MODULE['<{omnibuseufree}prestashop>configure_f7e5ee1fbf4617a1f7392a78df1c7f51'] = 'Usuń nieaktualne dane';
|
||||
$_MODULE['<{omnibuseufree}prestashop>products-price-list_a593c6d1e05af324063dac348353cece'] = 'Odśwież stronę';
|
||||
$_MODULE['<{omnibuseufree}prestashop>products-price-list_60cd4fe878b3953e84fe70f7f37dea84'] = 'Zapisz ustawienia przed odświeżeniem strony!';
|
||||
$_MODULE['<{omnibuseufree}prestashop>products-price-list_74e5e485bacb9dab571e5acf673bd823'] = 'ID:';
|
||||
$_MODULE['<{omnibuseufree}prestashop>products-price-list_47c3f766582c23412805a4564235e319'] = 'Nazwa produktu:';
|
||||
$_MODULE['<{omnibuseufree}prestashop>products-price-list_75edf643d9f66f0f905722da73da0a94'] = 'Cena:';
|
||||
$_MODULE['<{omnibuseufree}prestashop>products-price-list_1b13b43983ddd15eb8c8023686e24cbb'] = 'Waluta:';
|
||||
$_MODULE['<{omnibuseufree}prestashop>products-price-list_bb3fa120d9acc4dd89421921b049645f'] = 'Ostatnia wartość:';
|
||||
$_MODULE['<{omnibuseufree}prestashop>products-price-list_a6054352db7de250c83770a6eac6383d'] = 'Data dodania';
|
||||
$_MODULE['<{omnibuseufree}prestashop>presta_studio_omnibus_price_fd8c93ac2518db4006d802382d71d257'] = 'Najniższa cena w ciągu %d dni przed obniżką: ';
|
||||
$_MODULE['<{omnibuseufree}prestashop>presta_studio_omnibus_price_75c403f3838c531bfefa5cec252b011e'] = 'Najniższa cena w ciągu %d dni: ';
|
||||
23
modules/omnibuseufree/upgrade/index.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
23
modules/omnibuseufree/upgrade/upgrade-1.1.0.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_1_1_0($module)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
10
modules/omnibuseufree/vendor/.htaccess
vendored
Normal 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>
|
||||
25
modules/omnibuseufree/vendor/autoload.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
// autoload.php @generated by Composer
|
||||
|
||||
if (PHP_VERSION_ID < 50600) {
|
||||
if (!headers_sent()) {
|
||||
header('HTTP/1.1 500 Internal Server Error');
|
||||
}
|
||||
$err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL;
|
||||
if (!ini_get('display_errors')) {
|
||||
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
|
||||
fwrite(STDERR, $err);
|
||||
} elseif (!headers_sent()) {
|
||||
echo $err;
|
||||
}
|
||||
}
|
||||
trigger_error(
|
||||
$err,
|
||||
E_USER_ERROR
|
||||
);
|
||||
}
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInit26f72ce49b24d770f51f3125f1089bff::getLoader();
|
||||
581
modules/omnibuseufree/vendor/composer/ClassLoader.php
vendored
Normal file
@@ -0,0 +1,581 @@
|
||||
<?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 https://www.php-fig.org/psr/psr-0/
|
||||
* @see https://www.php-fig.org/psr/psr-4/
|
||||
*/
|
||||
class ClassLoader
|
||||
{
|
||||
/** @var \Closure(string):void */
|
||||
private static $includeFile;
|
||||
|
||||
/** @var ?string */
|
||||
private $vendorDir;
|
||||
|
||||
// PSR-4
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array<string, int>>
|
||||
*/
|
||||
private $prefixLengthsPsr4 = array();
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array<int, string>>
|
||||
*/
|
||||
private $prefixDirsPsr4 = array();
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, string>
|
||||
*/
|
||||
private $fallbackDirsPsr4 = array();
|
||||
|
||||
// PSR-0
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array<string, string[]>>
|
||||
*/
|
||||
private $prefixesPsr0 = array();
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, string>
|
||||
*/
|
||||
private $fallbackDirsPsr0 = array();
|
||||
|
||||
/** @var bool */
|
||||
private $useIncludePath = false;
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
* @psalm-var array<string, string>
|
||||
*/
|
||||
private $classMap = array();
|
||||
|
||||
/** @var bool */
|
||||
private $classMapAuthoritative = false;
|
||||
|
||||
/**
|
||||
* @var bool[]
|
||||
* @psalm-var array<string, bool>
|
||||
*/
|
||||
private $missingClasses = array();
|
||||
|
||||
/** @var ?string */
|
||||
private $apcuPrefix;
|
||||
|
||||
/**
|
||||
* @var self[]
|
||||
*/
|
||||
private static $registeredLoaders = array();
|
||||
|
||||
/**
|
||||
* @param ?string $vendorDir
|
||||
*/
|
||||
public function __construct($vendorDir = null)
|
||||
{
|
||||
$this->vendorDir = $vendorDir;
|
||||
self::initializeIncludeClosure();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function getPrefixes()
|
||||
{
|
||||
if (!empty($this->prefixesPsr0)) {
|
||||
return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
|
||||
}
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return array<string, array<int, string>>
|
||||
*/
|
||||
public function getPrefixesPsr4()
|
||||
{
|
||||
return $this->prefixDirsPsr4;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return array<string, string>
|
||||
*/
|
||||
public function getFallbackDirs()
|
||||
{
|
||||
return $this->fallbackDirsPsr0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return array<string, string>
|
||||
*/
|
||||
public function getFallbackDirsPsr4()
|
||||
{
|
||||
return $this->fallbackDirsPsr4;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[] Array of classname => path
|
||||
* @psalm-return array<string, string>
|
||||
*/
|
||||
public function getClassMap()
|
||||
{
|
||||
return $this->classMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string[] $classMap Class to filename map
|
||||
* @psalm-param array<string, string> $classMap
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
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 string[]|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
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 string[]|string $paths The PSR-4 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
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 string[]|string $paths The PSR-0 base directories
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
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 string[]|string $paths The PSR-4 base directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
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
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register($prepend = false)
|
||||
{
|
||||
spl_autoload_register(array($this, 'loadClass'), true, $prepend);
|
||||
|
||||
if (null === $this->vendorDir) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($prepend) {
|
||||
self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders;
|
||||
} else {
|
||||
unset(self::$registeredLoaders[$this->vendorDir]);
|
||||
self::$registeredLoaders[$this->vendorDir] = $this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Unregisters this instance as an autoloader.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function unregister()
|
||||
{
|
||||
spl_autoload_unregister(array($this, 'loadClass'));
|
||||
|
||||
if (null !== $this->vendorDir) {
|
||||
unset(self::$registeredLoaders[$this->vendorDir]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the given class or interface.
|
||||
*
|
||||
* @param string $class The name of the class
|
||||
* @return true|null True if loaded, null otherwise
|
||||
*/
|
||||
public function loadClass($class)
|
||||
{
|
||||
if ($file = $this->findFile($class)) {
|
||||
(self::$includeFile)($file);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the currently registered loaders indexed by their corresponding vendor directories.
|
||||
*
|
||||
* @return self[]
|
||||
*/
|
||||
public static function getRegisteredLoaders()
|
||||
{
|
||||
return self::$registeredLoaders;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $class
|
||||
* @param string $ext
|
||||
* @return string|false
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
private static function initializeIncludeClosure(): void
|
||||
{
|
||||
if (self::$includeFile !== null) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scope isolated include.
|
||||
*
|
||||
* Prevents access to $this/self from included files.
|
||||
*
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
self::$includeFile = static function($file) {
|
||||
include $file;
|
||||
};
|
||||
}
|
||||
}
|
||||
21
modules/omnibuseufree/vendor/composer/LICENSE
vendored
Normal 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.
|
||||
|
||||
12
modules/omnibuseufree/vendor/composer/autoload_classmap.php
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
// autoload_classmap.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
|
||||
'Omnibus\\Compatibility\\PrestashopCompatibility' => $baseDir . '/src/compatibility/PrestashopCompatibility.php',
|
||||
'Omnibus\\Controller\\MenuController' => $baseDir . '/src/controller/MenuController.php',
|
||||
);
|
||||
9
modules/omnibuseufree/vendor/composer/autoload_namespaces.php
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
// autoload_namespaces.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
);
|
||||
11
modules/omnibuseufree/vendor/composer/autoload_psr4.php
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
// autoload_psr4.php @generated by Composer
|
||||
|
||||
$vendorDir = dirname(__DIR__);
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Omnibus\\Controller\\' => array($baseDir . '/src/controller'),
|
||||
'Omnibus\\Compatibility\\' => array($baseDir . '/src/compatibility'),
|
||||
);
|
||||
36
modules/omnibuseufree/vendor/composer/autoload_real.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInit26f72ce49b24d770f51f3125f1089bff
|
||||
{
|
||||
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('ComposerAutoloaderInit26f72ce49b24d770f51f3125f1089bff', 'loadClassLoader'), true, false);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInit26f72ce49b24d770f51f3125f1089bff', 'loadClassLoader'));
|
||||
|
||||
require __DIR__ . '/autoload_static.php';
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInit26f72ce49b24d770f51f3125f1089bff::getInitializer($loader));
|
||||
|
||||
$loader->register(false);
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
43
modules/omnibuseufree/vendor/composer/autoload_static.php
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
// autoload_static.php @generated by Composer
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInit26f72ce49b24d770f51f3125f1089bff
|
||||
{
|
||||
public static $prefixLengthsPsr4 = array (
|
||||
'O' =>
|
||||
array (
|
||||
'Omnibus\\Controller\\' => 19,
|
||||
'Omnibus\\Compatibility\\' => 22,
|
||||
),
|
||||
);
|
||||
|
||||
public static $prefixDirsPsr4 = array (
|
||||
'Omnibus\\Controller\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/../..' . '/src/controller',
|
||||
),
|
||||
'Omnibus\\Compatibility\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/../..' . '/src/compatibility',
|
||||
),
|
||||
);
|
||||
|
||||
public static $classMap = array (
|
||||
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
|
||||
'Omnibus\\Compatibility\\PrestashopCompatibility' => __DIR__ . '/../..' . '/src/compatibility/PrestashopCompatibility.php',
|
||||
'Omnibus\\Controller\\MenuController' => __DIR__ . '/../..' . '/src/controller/MenuController.php',
|
||||
);
|
||||
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit26f72ce49b24d770f51f3125f1089bff::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit26f72ce49b24d770f51f3125f1089bff::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInit26f72ce49b24d770f51f3125f1089bff::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
}
|
||||
23
modules/omnibuseufree/vendor/composer/index.php
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
23
modules/omnibuseufree/vendor/index.php
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
76
modules/omnibuseufree/views/css/back.css
Normal file
@@ -0,0 +1,76 @@
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
|
||||
.module-omnibuseufree h2{
|
||||
padding-top:0 !important;
|
||||
}
|
||||
|
||||
.presta-studio-omnibus-header{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.presta-studio-documentation-list,
|
||||
.bootstrap ul.presta-studio-documentation-list {
|
||||
margin-bottom:20px;
|
||||
}
|
||||
|
||||
.presta-studio-omnibus-header-right a img{
|
||||
margin-left:16px;
|
||||
}
|
||||
|
||||
.presta-studio-omnibus-header-left i{
|
||||
margin-top: -2px;
|
||||
margin-right: 5px;
|
||||
font-size: 20px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.presta-studio-ads,
|
||||
.presta-studio-ads-mobile{
|
||||
border:1px solid #000;
|
||||
}
|
||||
|
||||
.presta-studio-ads-mobile{
|
||||
display: none;
|
||||
}
|
||||
.presta-studio-ads{
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.omnibus-select-version{
|
||||
min-width: 310px !important;
|
||||
}
|
||||
|
||||
.omnibus-input-days{
|
||||
width: 64px !important;
|
||||
}
|
||||
|
||||
@media (max-width: 450px) {
|
||||
.presta-studio-omnibus-header-right .follow-presta-studio {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.presta-studio-ads-mobile{
|
||||
display: inline-block;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
.presta-studio-ads{
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
23
modules/omnibuseufree/views/css/index.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
.presta-studio-price-history .presta-studio-price-history-text{
|
||||
color: #000000;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
BIN
modules/omnibuseufree/views/img/baner_en.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
modules/omnibuseufree/views/img/baner_mobile_en.png
Normal file
|
After Width: | Height: | Size: 9.7 KiB |
BIN
modules/omnibuseufree/views/img/baner_mobile_pl.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
modules/omnibuseufree/views/img/baner_pl.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
23
modules/omnibuseufree/views/img/index.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
BIN
modules/omnibuseufree/views/img/presta_studio_logo.png
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
BIN
modules/omnibuseufree/views/img/yt_logo.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
23
modules/omnibuseufree/views/index.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
23
modules/omnibuseufree/views/js/back.js
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
var OmnibusReloadButton = document.getElementById("omnibuseu-by-presta-studio-reload");
|
||||
|
||||
if (OmnibusReloadButton) {
|
||||
OmnibusReloadButton.onclick = function() {
|
||||
location.reload();
|
||||
};
|
||||
}
|
||||
});
|
||||
23
modules/omnibuseufree/views/js/index.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
77
modules/omnibuseufree/views/templates/admin/configure.tpl
Normal file
@@ -0,0 +1,77 @@
|
||||
{*
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*
|
||||
*}
|
||||
|
||||
<div class="panel">
|
||||
<div class="panel-heading">
|
||||
<div class="presta-studio-omnibus-header">
|
||||
<div class="presta-studio-omnibus-header-left">
|
||||
<i class="icon icon-tags"></i>{l s='Documentation' mod='omnibuseufree'}
|
||||
</div>
|
||||
<div class="presta-studio-omnibus-header-right">
|
||||
<a href="https://presta.studio" target="_blank"><img src="{$module_dir}views/img/presta_studio_logo.png" width="92" height="16" alt="presta.studio"></a>
|
||||
<a href="https://www.youtube.com/@presta.studio" target="_blank" class="follow-presta-studio"><img src="{$module_dir}views/img/yt_logo.png" width="71" height="16" alt="Follow us on YouTube"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<p>» {l s='Module installation and configuration' mod='omnibuseufree'}:</p>
|
||||
<ul class="presta-studio-documentation-list">
|
||||
<li><a href="https://presta.studio/omnibus-documentation-en" target="_blank">{l s='English' mod='omnibuseufree'}</a></li>
|
||||
<li><a href="https://presta.studio/omnibus-documentation-pl" target="_blank">{l s='Polish' mod='omnibuseufree'}</a></li>
|
||||
</ul>
|
||||
|
||||
<p >» {l s='Follow us on' mod='omnibuseufree'}:</p>
|
||||
<ul>
|
||||
<li><a href="https://www.youtube.com/@presta.studio" target="_blank">YouTube</a></li>
|
||||
<li><a href="https://presta.studio/github" target="_blank">GitHub</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel">
|
||||
<div class="panel-body text-center">
|
||||
{if $lang == 'pl'}
|
||||
<a href="https://presta.studio/pl/" target="_blank"><img src="{$module_dir}views/img/baner_pl.png" width="750" height="100" class="presta-studio-ads"></a>
|
||||
<a href="https://presta.studio/pl/" target="_blank"><img src="{$module_dir}views/img/baner_mobile_pl.png" width="300" height="250" class="presta-studio-ads-mobile"></a>
|
||||
{else}
|
||||
<a href="https://presta.studio/" target="_blank"><img src="{$module_dir}views/img/baner_en.png" width="750" height="100" class="presta-studio-ads"></a>
|
||||
<a href="https://presta.studio/" target="_blank"><img src="{$module_dir}views/img/baner_mobile_en.png" width="300" height="250" class="presta-studio-ads-mobile"></a>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel">
|
||||
<div class="panel-heading">
|
||||
<i class="material-icons md48">sync</i>{l s='CRON' mod='omnibuseufree'}
|
||||
</div>
|
||||
<div class="panel-body form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-4">
|
||||
{l s='Update prices' mod='omnibuseufree'}
|
||||
</label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control disabled" id="omnibus-cron-update-prices" disabled value="{if $cron_status == '1'}{$update_prices}{else}{l s='CRON is disabled.' mod='omnibuseufree'}{/if}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label col-lg-4">
|
||||
{l s='Delete outdated data' mod='omnibuseufree'}
|
||||
</label>
|
||||
<div class="col-lg-8">
|
||||
<input type="text" class="form-control disabled" id="omnibus-cron-outdated-data" disabled value="{if $cron_status == '1'}{$delete_outdated_data}{else}{l s='CRON is disabled.' mod='omnibuseufree'}{/if}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
23
modules/omnibuseufree/views/templates/admin/index.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
@@ -0,0 +1,50 @@
|
||||
{*
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*
|
||||
*}
|
||||
|
||||
<div class="mb-4">
|
||||
<button type="button" class="btn btn-primary" aria-label="Iceberg" id="omnibuseu-by-presta-studio-reload">
|
||||
<i class="material-icons">rotate_right</i> {l s='Refresh page' mod='omnibuseufree'}
|
||||
</button>
|
||||
<div class="small mt-1 font-weight-bold">
|
||||
{l s='Save changes before refresh page!' mod='omnibuseufree'}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{l s='ID: ' mod='omnibuseufree'}</th>
|
||||
<th>{l s='Product name: ' mod='omnibuseufree'}</th>
|
||||
<th>{l s='Price: ' mod='omnibuseufree'}</th>
|
||||
<th>{l s='Currency: ' mod='omnibuseufree'}</th>
|
||||
<th>{l s='Last value: ' mod='omnibuseufree'}</th>
|
||||
<th>{l s='Date Added: ' mod='omnibuseufree'}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{if !empty($OmnibuseufreeData)}
|
||||
{foreach from=$OmnibuseufreeData item=item key=key}
|
||||
<tr>
|
||||
<th scope="row">{$key+1}</th>
|
||||
<td>{$item.name}</td>
|
||||
<td>{$item.price_locale}</td>
|
||||
<td>{$item.currency_iso_code}</td>
|
||||
<td>{$item.is_last_icon}</td>
|
||||
<td>{$item.date_add}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
23
modules/omnibuseufree/views/templates/hook/index.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
@@ -0,0 +1,31 @@
|
||||
{*
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*
|
||||
*}
|
||||
|
||||
{if $OmnibuseufreeProductDiscount == true}
|
||||
<div class="presta-studio-price-history">
|
||||
<p class="presta-studio-price-history-text">
|
||||
{if $OmnibuseufreeInfoVersion == 2}
|
||||
{if $OmnibuseufreeProductPriceMin != null}
|
||||
{l s='Lowest price in %d days before discount: ' sprintf=[$OmnibuseufreeNumberOfDays] mod='omnibuseufree'}<span class="presta-studio-price-history-price">{$OmnibuseufreeProductPriceMin}</span>
|
||||
{else}
|
||||
{* when history is empty *}
|
||||
{l s='Lowest price in %d days: ' sprintf=[$OmnibuseufreeNumberOfDays] mod='omnibuseufree'}<span class="presta-studio-price-history-price">{$OmnibuseufreeProductPriceCurrent}</span>
|
||||
{/if}
|
||||
{else}
|
||||
{l s='Lowest price in %d days: ' sprintf=[$OmnibuseufreeNumberOfDays] mod='omnibuseufree'}<span class="presta-studio-price-history-price">{$OmnibuseufreeProductPriceMin}</span>
|
||||
{/if}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
23
modules/omnibuseufree/views/templates/index.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Apache License, Version 2.0
|
||||
* that is bundled with this package in the file LICENSE.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* @author presta.studio
|
||||
* @copyright Copyright (c) 2023 presta.studio
|
||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||