[-] BO : fix bug #PSCFV-2268 - blocklink bug with multishop and link list
This commit is contained in:
@@ -113,9 +113,14 @@ class BlockLink extends Module
|
|||||||
{
|
{
|
||||||
$result = array();
|
$result = array();
|
||||||
// Get id and url
|
// Get id and url
|
||||||
if (!$links = Db::getInstance()->executeS('SELECT `id_blocklink`, `url`, `new_window`
|
|
||||||
FROM '._DB_PREFIX_.'blocklink'.
|
$sql = 'SELECT b.`id_blocklink`, b.`url`, b.`new_window`
|
||||||
((int)Configuration::get('PS_BLOCKLINK_ORDERWAY') == 1 ? ' ORDER BY `id_blocklink` DESC' : '')))
|
FROM `'._DB_PREFIX_.'blocklink` b';
|
||||||
|
if (Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_ALL)
|
||||||
|
$sql .= ' JOIN `'._DB_PREFIX_.'blocklink_shop` bs ON b.`id_blocklink` = bs.`id_blocklink` AND bs.`id_shop` IN ('.implode(', ', Shop::getContextListShopID()).') ';
|
||||||
|
$sql .= (int)Configuration::get('PS_BLOCKLINK_ORDERWAY') == 1 ? ' ORDER BY `id_blocklink` DESC' : '';
|
||||||
|
|
||||||
|
if (!$links = Db::getInstance()->executeS($sql))
|
||||||
return false;
|
return false;
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($links as $link)
|
foreach ($links as $link)
|
||||||
|
|||||||
Reference in New Issue
Block a user