[-] BO : fix bug #PSCFV-2231 - blocklink problem when not in multishop

This commit is contained in:
tDidierjean committed 2012-05-09 14:10:33 +00:00
1 parent c19b032b4c
commit e80498c877
1 file changed
+14 -1
+14 -1
View File
@@ -183,14 +183,27 @@ class BlockLink extends Module
return false; return false;
} }
$assos_shop = Tools::getValue('checkBoxShopAsso_blocklink');
Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'blocklink_shop WHERE id_blocklink='.(int)$id_link); Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'blocklink_shop WHERE id_blocklink='.(int)$id_link);
if (!Shop::isFeatureActive())
{
Db::getInstance()->insert('blocklink_shop', array(
'id_blocklink' => (int)$id_link,
'id_shop' => (int)Context::getContext()->shop->id,
));
}
else
{
$assos_shop = Tools::getValue('checkBoxShopAsso_blocklink');
if (empty($assos_shop))
return false;
foreach ($assos_shop as $asso) foreach ($assos_shop as $asso)
foreach ($asso as $id_shop => $row) foreach ($asso as $id_shop => $row)
Db::getInstance()->insert('blocklink_shop', array( Db::getInstance()->insert('blocklink_shop', array(
'id_blocklink' => (int)$id_link, 'id_blocklink' => (int)$id_link,
'id_shop' => (int)$id_shop, 'id_shop' => (int)$id_shop,
)); ));
}
return true; return true;
} }