- Added Italian translations for various module strings in it.php. - Added German translations for various module strings in de.php. - Implemented Gm_OmniPriceCronModuleFrontController to handle cron actions such as indexing, cleanup, and filling missing cache. - Created index.php file to redirect access to the module's front controller.
42 lines
1.4 KiB
PHP
42 lines
1.4 KiB
PHP
<?php
|
|
|
|
$start = microtime(true);
|
|
require('template.php');
|
|
require_once(dirname(__FILE__) . '/../../config/config.inc.php');
|
|
if (Module::isEnabled('groupinc')) {
|
|
require_once(dirname(__FILE__) . '/../../init.php');
|
|
}
|
|
$omni = Module::getInstanceByName('gm_omniprice');
|
|
$token = Tools::getValue('token');
|
|
$comparedToken = Tools::getAdminToken('gm_omniprice');
|
|
if ($token != $comparedToken) {
|
|
die('invalid token');
|
|
}
|
|
echo 'PS ' . _PS_VERSION_ . '<br/>';
|
|
echo 'OmniPrice ' . $omni->version . '<br/>';
|
|
if (Tools::isSubmit('reset')) {
|
|
$omni->resetIndex();
|
|
echo 'RESET</br>';
|
|
}
|
|
$productId = null;
|
|
if (Tools::isSubmit('pid')) {
|
|
$productId = (int) Tools::getValue('pid');
|
|
$omni->removeProductFromTodaysIndex($productId);
|
|
$omni->removeProductFromTodaysHistory($productId);
|
|
}
|
|
$omni->savePrices(true, $productId);
|
|
echo 'FINISH<br/>';
|
|
if (Tools::isSubmit('debug')) {
|
|
echo 'DEBUG:<br/>';
|
|
$debug = Db::getInstance()->executeS('SELECT * FROM `' . _DB_PREFIX_ . 'gm_omniprice_history` WHERE `id_product` = ' . $productId);
|
|
if ($debug) {
|
|
echo $omni->displayTable($debug, array_keys($debug[0]));
|
|
}
|
|
$debug = Db::getInstance()->executeS('SELECT * FROM `' . _DB_PREFIX_ . 'gm_omniprice_cache` WHERE `id_product` = ' . $productId);
|
|
if ($debug) {
|
|
echo $omni->displayTable($debug, array_keys($debug[0]));
|
|
}
|
|
}
|
|
$timeElapsedSeconds = microtime(true) - $start;
|
|
echo round($timeElapsedSeconds, 4) . ' s<br/>';
|