From ccd7bad05cdf71c34b610518deae9ecdd0df15ce Mon Sep 17 00:00:00 2001 From: vChabot Date: Tue, 31 Jan 2012 15:31:32 +0000 Subject: [PATCH] // categories multishop improved git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12866 b9a71923-0436-4b27-9f14-aed3839534dd --- modules/blockcategories/blockcategories.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/blockcategories/blockcategories.php b/modules/blockcategories/blockcategories.php index da961eeef..2ebc8957b 100644 --- a/modules/blockcategories/blockcategories.php +++ b/modules/blockcategories/blockcategories.php @@ -176,6 +176,7 @@ class BlockCategories extends Module FROM `'._DB_PREFIX_.'category` c LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.`id_lang` = '.$id_lang.$this->context->shop->addSqlRestrictionOnLang('cl').') LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cg.`id_category` = c.`id_category`) + LEFT JOIN `'._DB_PREFIX_.'category_shop` cs ON (cs.`id_category` = c.`id_category` AND cs.`id_shop` = '.(int)Context::getContext()->shop->getID(true).') WHERE (c.`active` = 1 OR c.`id_category` = 1) '.((int)($maxdepth) != 0 ? ' AND `level_depth` <= '.(int)($maxdepth) : '').' AND cg.`id_group` IN ('.pSQL($groups).') @@ -186,9 +187,11 @@ class BlockCategories extends Module FROM `'._DB_PREFIX_.'category` c LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.`id_lang` = '.$id_lang.$this->context->shop->addSqlRestrictionOnLang('cl').') LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cg.`id_category` = c.`id_category`) + LEFT JOIN `'._DB_PREFIX_.'category_shop` cs ON (cs.`id_category` = c.`id_category`) WHERE (c.`active` = 1 OR c.`id_category` = 1) '.((int)($maxdepth) != 0 ? ' AND `level_depth` <= '.(int)($maxdepth) : '').' AND cg.`id_group` IN ('.pSQL($groups).') + AND cs.`id_shop` = '.(int)Context::getContext()->shop->getID(true).' GROUP BY id_category ORDER BY `level_depth` ASC, '.(Configuration::get('BLOCK_CATEG_SORT') ? 'cl.`name`' : 'c.`position`').' '.(Configuration::get('BLOCK_CATEG_SORT_WAY') ? 'DESC' : 'ASC')))