From 241ddaf652ae85ac4f1a066ea5cd9a96b1b69755 Mon Sep 17 00:00:00 2001 From: vChabot Date: Thu, 9 Feb 2012 09:49:42 +0000 Subject: [PATCH] [-] BO : BugFix : #PSFV-462 : category tree view displayed according to he shop context git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13168 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/helper/Helper.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/classes/helper/Helper.php b/classes/helper/Helper.php index e6cee2f71..21ae3a00c 100755 --- a/classes/helper/Helper.php +++ b/classes/helper/Helper.php @@ -172,7 +172,16 @@ class HelperCore ); $top_category = Category::getTopCategory(); - $id_shop = Tools::isSubmit('id_shop') ? Tools::getValue('id_shop'): Configuration::get('PS_SHOP_DEFAULT'); + if (Tools::isSubmit('id_shop')) + $id_shop = Tools::getValue('id_shop'); + else + if (Context::getContext()->shop->id) + $id_shop = Context::getContext()->shop->id; + else + if (!Shop::isFeatureActive()) + $id_shop = Configuration::get('PS_SHOP_DEFAULT'); + else + $id_shop = 0; $shop = new Shop($id_shop); $root_category = Category::getRootCategory(null, $shop); $disabled_categories[] = $top_category->id;