diff --git a/classes/Category.php b/classes/Category.php index b129ed194..17168eb11 100644 --- a/classes/Category.php +++ b/classes/Category.php @@ -547,6 +547,7 @@ class CategoryCore extends ObjectModel $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT c.*, cl.id_lang, cl.name, cl.description, cl.link_rewrite, cl.meta_title, cl.meta_keywords, cl.meta_description FROM `'._DB_PREFIX_.'category` c + '.Shop::addSqlAssociation('category', 'c').' LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND `id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('cl').') @@ -556,7 +557,7 @@ class CategoryCore extends ObjectModel '.($active ? 'AND `active` = 1' : '').' AND cg.`id_group` '.$sql_groups.' GROUP BY c.`id_category` - ORDER BY `level_depth` ASC, c.`position` ASC + ORDER BY `level_depth` ASC, category_shop.`position` ASC '); foreach ($result as &$row) diff --git a/controllers/admin/AdminCategoriesController.php b/controllers/admin/AdminCategoriesController.php index 25321fffb..1d34370a8 100644 --- a/controllers/admin/AdminCategoriesController.php +++ b/controllers/admin/AdminCategoriesController.php @@ -103,7 +103,7 @@ class AdminCategoriesControllerCore extends AdminController $this->_category = new Category(Configuration::get('PS_HOME_CATEGORY')); // if we are not in a shop context, we remove the position column - if (Shop::getContext() != Shop::CONTEXT_SHOP) + if (Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_SHOP) unset($this->fields_list['position']); // shop restriction : if category is not available for current shop, we redirect to the list from default category if (!Shop::isCategoryAvailable($this->_category->id))