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

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15112 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2012-05-09 14:10:33 +00:00
parent 08ee61a806
commit b9497e80a7
+20 -7
View File
@@ -183,14 +183,27 @@ class BlockLink extends Module
return false;
}
$assos_shop = Tools::getValue('checkBoxShopAsso_blocklink');
Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'blocklink_shop WHERE id_blocklink='.(int)$id_link);
foreach ($assos_shop as $asso)
foreach ($asso as $id_shop => $row)
Db::getInstance()->insert('blocklink_shop', array(
'id_blocklink' => (int)$id_link,
'id_shop' => (int)$id_shop,
));
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 ($asso as $id_shop => $row)
Db::getInstance()->insert('blocklink_shop', array(
'id_blocklink' => (int)$id_link,
'id_shop' => (int)$id_shop,
));
}
return true;
}