[-] MO : Fix bug #PSCFV-10787, cms associated to all shops
This commit is contained in:
1 parent
d20aea0563
commit
1ae587475b
1 file changed
+7
-3
@@ -364,15 +364,20 @@ class BlockCMSModel extends ObjectModel
|
|||||||
return Db::getInstance()->executeS($sql);
|
return Db::getInstance()->executeS($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getCMSBlockPages($id_block)
|
public static function getCMSBlockPages($id_block, $id_shop = false)
|
||||||
{
|
{
|
||||||
|
$id_shop = ($id_shop !== false) ? $id_shop : Context::getContext()->shop->id;
|
||||||
|
|
||||||
$sql = 'SELECT cl.`id_cms`, cl.`meta_title`, cl.`link_rewrite`
|
$sql = 'SELECT cl.`id_cms`, cl.`meta_title`, cl.`link_rewrite`
|
||||||
FROM `'._DB_PREFIX_.'cms_block_page` bcp
|
FROM `'._DB_PREFIX_.'cms_block_page` bcp
|
||||||
INNER JOIN `'._DB_PREFIX_.'cms_lang` cl
|
INNER JOIN `'._DB_PREFIX_.'cms_lang` cl
|
||||||
ON (bcp.`id_cms` = cl.`id_cms`)
|
ON (bcp.`id_cms` = cl.`id_cms`)
|
||||||
INNER JOIN `'._DB_PREFIX_.'cms` c
|
INNER JOIN `'._DB_PREFIX_.'cms` c
|
||||||
ON (bcp.`id_cms` = c.`id_cms`)
|
ON (bcp.`id_cms` = c.`id_cms`)
|
||||||
|
INNER JOIN `'._DB_PREFIX_.'cms_shop` cs
|
||||||
|
ON (c.`id_cms` = cs.`id_cms`)
|
||||||
WHERE bcp.`id_cms_block` = '.(int)$id_block.'
|
WHERE bcp.`id_cms_block` = '.(int)$id_block.'
|
||||||
|
AND cs.`id_shop` = '.(int)$id_shop.'
|
||||||
AND cl.`id_lang` = '.(int)Context::getContext()->language->id.'
|
AND cl.`id_lang` = '.(int)Context::getContext()->language->id.'
|
||||||
AND bcp.`is_category` = 0
|
AND bcp.`is_category` = 0
|
||||||
AND c.`active` = 1
|
AND c.`active` = 1
|
||||||
@@ -534,8 +539,7 @@ class BlockCMSModel extends ObjectModel
|
|||||||
{
|
{
|
||||||
$key = (int)$cmsCategory['id_cms_block'];
|
$key = (int)$cmsCategory['id_cms_block'];
|
||||||
$content[$key]['display_store'] = $cmsCategory['display_store'];
|
$content[$key]['display_store'] = $cmsCategory['display_store'];
|
||||||
$content[$key]['cms'] = BlockCMSModel::getCMSBlockPages($cmsCategory['id_cms_block']);
|
$content[$key]['cms'] = BlockCMSModel::getCMSBlockPages($cmsCategory['id_cms_block'], $id_shop);
|
||||||
|
|
||||||
$links = array();
|
$links = array();
|
||||||
if (count($content[$key]['cms']))
|
if (count($content[$key]['cms']))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user