// Fix stores with multishop + hide blockstore if no store

This commit is contained in:
rMalie
2012-02-28 15:35:15 +00:00
parent 294821df62
commit 421b307c7d
3 changed files with 13 additions and 8 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>blocksearch</name>
<displayName><![CDATA[Quick Search block]]></displayName>
<version><![CDATA[1]]></version>
<version><![CDATA[1.1]]></version>
<description><![CDATA[Adds a block with a quick search field.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[search_filter]]></tab>
+7 -1
View File
@@ -64,7 +64,13 @@ class BlockStore extends Module
function hookRightColumn($params)
{
$this->smarty->assign('store_img', Configuration::get('BLOCKSTORE_IMG'));
return $this->display(__FILE__, 'blockstore.tpl');
$sql = 'SELECT COUNT(*)
FROM '._DB_PREFIX_.'store s'
.Shop::addSqlAssociation('store', 's');
$total = Db::getInstance()->getValue($sql);
if ($total > 0)
return $this->display(__FILE__, 'blockstore.tpl');
}
function hookHeader($params)