// Fix multishop on Category->getChildrenWithNbSelectedSubCat() (best name ever)
This commit is contained in:
1 parent
ad78917187
commit
d0372f8e3b
1 file changed
+5
-10
+5
-10
@@ -804,18 +804,13 @@ class CategoryCore extends ObjectModel
|
|||||||
FROM `'._DB_PREFIX_.'category` c
|
FROM `'._DB_PREFIX_.'category` c
|
||||||
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON c.`id_category` = cl.`id_category`'.Shop::addSqlRestrictionOnLang('cl');
|
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON c.`id_category` = cl.`id_category`'.Shop::addSqlRestrictionOnLang('cl');
|
||||||
if (Shop::getContext() == Shop::CONTEXT_SHOP && $use_shop_context)
|
if (Shop::getContext() == Shop::CONTEXT_SHOP && $use_shop_context)
|
||||||
$sql .= '
|
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'category_shop` cs ON (c.`id_category` = cs.`id_category` AND cs.`id_shop` = '.(int)$id_shop.')';
|
||||||
LEFT JOIN `'._DB_PREFIX_.'category_shop` cs ON (c.`id_category` = cs.`id_category` AND cs.`id_shop` = '.(int)$id_shop.')';
|
$sql .= ' WHERE `id_lang` = '.(int)$id_lang;
|
||||||
$sql .= '
|
|
||||||
WHERE `id_lang` = '.(int)$id_lang;
|
|
||||||
if (Shop::getContext() == Shop::CONTEXT_SHOP && $use_shop_context)
|
if (Shop::getContext() == Shop::CONTEXT_SHOP && $use_shop_context)
|
||||||
$sql .= '
|
$sql .= ' AND cs.`id_shop` = '.(int)$shop->id;
|
||||||
AND cs.`id_shop` = '.(int)$shop->id;
|
$sql .= ' AND c.`id_parent` = '.(int)$id_parent;
|
||||||
$sql .= '
|
|
||||||
AND c.`id_parent` = '.(int)$id_parent;
|
|
||||||
if (Shop::getContext() == Shop::CONTEXT_SHOP && $use_shop_context)
|
if (Shop::getContext() == Shop::CONTEXT_SHOP && $use_shop_context)
|
||||||
$sql .= '
|
$sql .= ' ORDER BY cs.`position` ASC';
|
||||||
ORDER BY cs.`position` ASC';
|
|
||||||
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
|
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user