From af3ff3ab013a3d7aa37d3d211b18457c5cfc3ac1 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 --- 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;