Skip to content

Commit

Permalink
Merge pull request #26 from prestamodule/dev
Browse files Browse the repository at this point in the history
Do not use hook AdminStatsModules alias, use displayAdminStatsModules
  • Loading branch information
PierreRambaud authored Dec 29, 2021
2 parents b132aba + 7cf2f11 commit 93ae2f0
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 2 deletions.
4 changes: 2 additions & 2 deletions statssales.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ public function __construct()

public function install()
{
return (parent::install() && $this->registerHook('AdminStatsModules'));
return (parent::install() && $this->registerHook('displayAdminStatsModules'));
}

public function hookAdminStatsModules()
public function hookDisplayAdminStatsModules()
{
$totals = $this->getTotals();
$currency = new Currency((int)Configuration::get('PS_CURRENCY_DEFAULT'));
Expand Down
35 changes: 35 additions & 0 deletions upgrade/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/

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;
33 changes: 33 additions & 0 deletions upgrade/upgrade-2.1.0.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

<?php
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/

/**
* @param Module $module
*
* @return bool
*/
function upgrade_module_2_1_0($module)
{
$module->unregisterHook('AdminStatsModules');
$module->registerHook('displayAdminStatsModules');

return true;
}

0 comments on commit 93ae2f0

Please sign in to comment.