From b8706ddd8a2a86992bfe8077cf6f9c95ddd20e8a Mon Sep 17 00:00:00 2001 From: rMalie Date: Wed, 17 Aug 2011 09:41:28 +0000 Subject: [PATCH] // Fix homefeatured products for multishop git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8086 b9a71923-0436-4b27-9f14-aed3839534dd --- classes/Category.php | 4 ++-- modules/homefeatured/homefeatured.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/Category.php b/classes/Category.php index e5b7a8e30..3c2805f6b 100644 --- a/classes/Category.php +++ b/classes/Category.php @@ -348,7 +348,7 @@ class CategoryCore extends ObjectModel $return = 1; foreach ($categories AS $id_category) { - $category = new Category((int)($id_category)); + $category = new Category($id_category); $return &= $category->delete(); } return $return; @@ -365,7 +365,7 @@ class CategoryCore extends ObjectModel if (!$this->id_parent) return 0; - $parentCategory = new Category((int)($this->id_parent)); + $parentCategory = new Category($this->id_parent); if (!Validate::isLoadedObject($parentCategory)) die('parent category does not exist'); return $parentCategory->level_depth + 1; diff --git a/modules/homefeatured/homefeatured.php b/modules/homefeatured/homefeatured.php index 4d627c40a..0fa27f833 100644 --- a/modules/homefeatured/homefeatured.php +++ b/modules/homefeatured/homefeatured.php @@ -92,7 +92,7 @@ class HomeFeatured extends Module function hookHome($params) { - $category = new Category(1, Configuration::get('PS_LANG_DEFAULT')); + $category = new Category(Context::getContext()->shop->getCategory(), Configuration::get('PS_LANG_DEFAULT')); $nb = (int)(Configuration::get('HOME_FEATURED_NBR')); $products = $category->getProducts($params['cookie']->id_lang, 1, ($nb ? $nb : 10)); $this->context->smarty->assign(array(