Skip to content

Commit

Permalink
Remove deprecated hooks and update to 2.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreRambaud committed Dec 13, 2021
1 parent ab22aa2 commit faf0a3f
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 8 deletions.
2 changes: 1 addition & 1 deletion config.xml
Expand Up @@ -2,7 +2,7 @@
<module>
<name>ps_featuredproducts</name>
<displayName><![CDATA[Featured products]]></displayName>
<version><![CDATA[2.1.1]]></version>
<version><![CDATA[2.1.2]]></version>
<description><![CDATA[Displays featured products in the central column of your homepage.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
Expand Down
14 changes: 7 additions & 7 deletions ps_featuredproducts.php
Expand Up @@ -41,7 +41,7 @@ public function __construct()
{
$this->name = 'ps_featuredproducts';
$this->author = 'PrestaShop';
$this->version = '2.1.1';
$this->version = '2.1.2';
$this->need_instance = 0;

$this->ps_versions_compliancy = [
Expand All @@ -67,9 +67,9 @@ public function install()
Configuration::updateValue('HOME_FEATURED_RANDOMIZE', false);

return parent::install()
&& $this->registerHook('addproduct')
&& $this->registerHook('updateproduct')
&& $this->registerHook('deleteproduct')
&& $this->registerHook('actionProductAdd')
&& $this->registerHook('actionProductUpdate')
&& $this->registerHook('actionProductDelete')
&& $this->registerHook('displayHome')
&& $this->registerHook('displayOrderConfirmation2')
&& $this->registerHook('displayCrossSellingShoppingCart')
Expand All @@ -85,17 +85,17 @@ public function uninstall()
return parent::uninstall();
}

public function hookAddProduct($params)
public function hookActionProductAdd($params)
{
$this->_clearCache('*');
}

public function hookUpdateProduct($params)
public function hookActionProductUpdate($params)
{
$this->_clearCache('*');
}

public function hookDeleteProduct($params)
public function hookActionProductDelete($params)
{
$this->_clearCache('*');
}
Expand Down
34 changes: 34 additions & 0 deletions upgrade/upgrade-2.1.2.php
@@ -0,0 +1,34 @@
<?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)
*/
if (!defined('_PS_VERSION_')) {
exit;
}

function upgrade_module_2_1_2($module)
{
$module->unregisterHook('addproduct');
$module->unregisterHook('updateproduct');
$module->unregisterHook('deleteproduct');
$module->registerHook('actionProductAdd');
$module->registerHook('actionProductUpdate');
$module->registerHook('actionProductDelete');

return true;
}

0 comments on commit faf0a3f

Please sign in to comment.