// Fix stores with multishop + hide blockstore if no store
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user