diff --git a/modules/blockcurrencies/blockcurrencies.php b/modules/blockcurrencies/blockcurrencies.php index 6aceb6cde..caeb7f20b 100644 --- a/modules/blockcurrencies/blockcurrencies.php +++ b/modules/blockcurrencies/blockcurrencies.php @@ -49,6 +49,16 @@ class BlockCurrencies extends Module return parent::install() && $this->registerHook('top') && $this->registerHook('header'); } + private function _prepareHook($params) + { + if (Configuration::get('PS_CATALOG_MODE')) + return; + + if (!count(Currency::getCurrencies())) + return ''; + $this->smarty->assign('blockcurrencies_sign', $this->context->currency->sign); + } + /** * Returns module content for header * @@ -57,12 +67,7 @@ class BlockCurrencies extends Module */ public function hookTop($params) { - if (Configuration::get('PS_CATALOG_MODE')) - return; - - if (!count(Currency::getCurrencies())) - return ''; - $this->smarty->assign('blockcurrencies_sign', $this->context->currency->sign); + $this->_prepareHook($params); return $this->display(__FILE__, 'blockcurrencies.tpl'); } @@ -73,10 +78,10 @@ class BlockCurrencies extends Module $this->context->controller->addCSS(($this->_path).'blockcurrencies.css', 'all'); } - public function hookMobileFooterChoice($params) + public function hookDisplayMobileFooterChoice($params) { - $this->smarty->assign('hook_mobile', true); - $this->hookTop($params); + $this->_prepareHook($params); + return $this->display(__FILE__, 'blockmobilecurrencies.tpl'); } } diff --git a/modules/blockcurrencies/blockcurrencies.tpl b/modules/blockcurrencies/blockcurrencies.tpl index d97ffb121..ffb9ee424 100644 --- a/modules/blockcurrencies/blockcurrencies.tpl +++ b/modules/blockcurrencies/blockcurrencies.tpl @@ -61,16 +61,4 @@ $(document).ready(function () { - -{if isset($hook_mobile)} -