Add initial module files and templates for Omnibus EU Free
- Created new image file for YouTube logo. - Added index.php files for views and templates with license notice and redirection. - Implemented back.js for page reload functionality with a button. - Developed configure.tpl for admin configuration panel with documentation links. - Created products-price-list.tpl for displaying product price data in a table format. - Added presta_studio_omnibus_price.tpl for displaying price history information. - Established hook templates for integration with PrestaShop.
This commit is contained in:
46
modules/omnibuseufree/controllers/front/cron.php
Normal file
46
modules/omnibuseufree/controllers/front/cron.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
23
modules/omnibuseufree/controllers/front/index.php
Normal file
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;
|
||||
Reference in New Issue
Block a user