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)} -
-
- -
-
-{/if} - diff --git a/modules/blockcurrencies/blockmobilecurrencies.tpl b/modules/blockcurrencies/blockmobilecurrencies.tpl new file mode 100644 index 000000000..9e4095579 --- /dev/null +++ b/modules/blockcurrencies/blockmobilecurrencies.tpl @@ -0,0 +1,41 @@ +{* +* 2007-2012 PrestaShop +* +* NOTICE OF LICENSE +* +* This source file is subject to the Academic Free License (AFL 3.0) +* that is bundled with this package in the file LICENSE.txt. +* It is also available through the world-wide-web at this URL: +* http://opensource.org/licenses/afl-3.0.php +* 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 http://www.prestashop.com for more information. +* +* @author PrestaShop SA +* @copyright 2007-2012 PrestaShop SA +* @version Release: $Revision: 6594 $ +* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*} + + + +
+
+
+ +
+
+
+ + \ No newline at end of file