diff --git a/CHANGELOG.md b/CHANGELOG.md index f1bc559..c09ac71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,16 @@ # Change Log All notable changes to this project will be documented in this file. +## [1.0.3] - 2024-04-19 + +### Added + +### Changed +* Consent Banner library upgraded to version 1.1.0 + +### Fixed +* issue with plugin upgrading, now hooks are refreshed during upgrade + ## [1.0.2] - 2024-04-12 ### Added @@ -9,7 +19,7 @@ All notable changes to this project will be documented in this file. * project structure optimization ### Fixed -* fixed issue with conflicting PrestaShop theme stylesheets +* issue with conflicting PrestaShop theme stylesheets ## [1.0.1] - 2024-03-26 diff --git a/gtmconsentmodebannerfree.php b/gtmconsentmodebannerfree.php index 5a60d3b..7329d40 100644 --- a/gtmconsentmodebannerfree.php +++ b/gtmconsentmodebannerfree.php @@ -37,7 +37,7 @@ public function __construct() { $this->name = 'gtmconsentmodebannerfree'; $this->author = 'Tag Concierge'; - $this->version = '1.0.2'; + $this->version = '1.0.3'; $this->ps_versions_compliancy = ['min' => '1.7.1.0', 'max' => _PS_VERSION_]; $this->bootstrap = true; $this->tab = 'advertising_marketing'; diff --git a/src/Hook/AssetsHook.php b/src/Hook/AssetsHook.php index 00a79c1..4a210c9 100644 --- a/src/Hook/AssetsHook.php +++ b/src/Hook/AssetsHook.php @@ -21,13 +21,13 @@ public function loadAssets(): void $this->getContext()->controller->registerJavascript( 'tag-concierge-consent-mode-banner', - 'https://public-assets.tagconcierge.com/cookies-banner-js/1.0.0/consent-banner.min.js', + 'https://public-assets.tagconcierge.com/consent-banner/1.1.0/cb.min.js', ['server' => 'remote', 'position' => 'head', 'priority' => 20] ); $this->getContext()->controller->registerStylesheet( 'tag-concierge-consent-mode-banner', - 'https://public-assets.tagconcierge.com/cookies-banner-js/1.0.0/styles/light.css', + 'https://public-assets.tagconcierge.com/consent-banner/1.1.0/styles/light.css', ['server' => 'remote', 'position' => 'head', 'priority' => 20] ); } diff --git a/src/Install/Installer.php b/src/Install/Installer.php index 99c868c..4c9e5af 100644 --- a/src/Install/Installer.php +++ b/src/Install/Installer.php @@ -44,6 +44,11 @@ public function uninstall(TagConciergeModuleInterface $module): bool return true; } + public function resetHooks(TagConciergeModuleInterface $module): bool + { + return $this->unregisterHooks($module) && $this->registerHooks($module); + } + private function registerHooks(TagConciergeModuleInterface $module): bool { foreach ($module->getHooks() as $hook) { @@ -54,4 +59,13 @@ private function registerHooks(TagConciergeModuleInterface $module): bool return true; } + + private function unregisterHooks(TagConciergeModuleInterface $module): bool + { + foreach ($module->getHooks() as $hook) { + $module->unregisterHook($hook); + } + + return true; + } } diff --git a/src/Install/ModuleTrait.php b/src/Install/ModuleTrait.php index d87dc74..042811d 100644 --- a/src/Install/ModuleTrait.php +++ b/src/Install/ModuleTrait.php @@ -54,6 +54,13 @@ public function uninstall(): bool return $installer->uninstall($this); } + public function resetHooks(): bool + { + $installer = InstallerFactory::create(); + + return $installer->resetHooks($this); + } + /** * @throws \SmartyException */ diff --git a/upgrade/Upgrade-1.0.3.php b/upgrade/Upgrade-1.0.3.php new file mode 100644 index 0000000..475cc84 --- /dev/null +++ b/upgrade/Upgrade-1.0.3.php @@ -0,0 +1,10 @@ +resetHooks(); +}