[-] BO : fixed bug #PSCFV-4472

This commit is contained in:
vAugagneur
2012-10-02 07:59:44 +00:00
parent 9cf0cc9380
commit ed625e6cef
+3 -3
View File
@@ -778,14 +778,14 @@ class CategoryCore extends ObjectModel
)' : '0').' AS nbSelectedSubCat
FROM `'._DB_PREFIX_.'category` c
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` '.Shop::addSqlRestrictionOnLang('cl', $id_shop).')';
if (Shop::getContext() == Shop::CONTEXT_SHOP && $use_shop_context)
$sql .= ' LEFT JOIN `'._DB_PREFIX_.'category_shop` cs ON (c.`id_category` = cs.`id_category` AND cs.`id_shop` = '.(int)$id_shop.')';
$sql .= ' 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;
if (Shop::getContext() == Shop::CONTEXT_SHOP && $use_shop_context)
$sql .= ' AND cs.`id_shop` = '.(int)$shop->id;
$sql .= ' AND c.`id_parent` = '.(int)$id_parent;
if (Shop::getContext() == Shop::CONTEXT_SHOP && $use_shop_context)
if (!Shop::isFeatureActive() || Shop::getContext() == Shop::CONTEXT_SHOP && $use_shop_context)
$sql .= ' ORDER BY cs.`position` ASC';
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql);
}