[-] BO : fix bug #PSCFV-2231 - blocklink problem when not in multishop
This commit is contained in:
@@ -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);
|
||||||
foreach ($assos_shop as $asso)
|
|
||||||
foreach ($asso as $id_shop => $row)
|
if (!Shop::isFeatureActive())
|
||||||
Db::getInstance()->insert('blocklink_shop', array(
|
{
|
||||||
'id_blocklink' => (int)$id_link,
|
Db::getInstance()->insert('blocklink_shop', array(
|
||||||
'id_shop' => (int)$id_shop,
|
'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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user