// Fix homefeatured products for multishop

This commit is contained in:
rMalie committed 2011-08-17 09:41:28 +00:00
1 parent 72972da94c
commit a9a1706085
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -348,7 +348,7 @@ class CategoryCore extends ObjectModel
$return = 1; $return = 1;
foreach ($categories AS $id_category) foreach ($categories AS $id_category)
{ {
$category = new Category((int)($id_category)); $category = new Category($id_category);
$return &= $category->delete(); $return &= $category->delete();
} }
return $return; return $return;
@@ -365,7 +365,7 @@ class CategoryCore extends ObjectModel
if (!$this->id_parent) if (!$this->id_parent)
return 0; return 0;
$parentCategory = new Category((int)($this->id_parent)); $parentCategory = new Category($this->id_parent);
if (!Validate::isLoadedObject($parentCategory)) if (!Validate::isLoadedObject($parentCategory))
die('parent category does not exist'); die('parent category does not exist');
return $parentCategory->level_depth + 1; return $parentCategory->level_depth + 1;
+1 -1
View File
@@ -92,7 +92,7 @@ class HomeFeatured extends Module
function hookHome($params) 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')); $nb = (int)(Configuration::get('HOME_FEATURED_NBR'));
$products = $category->getProducts($params['cookie']->id_lang, 1, ($nb ? $nb : 10)); $products = $category->getProducts($params['cookie']->id_lang, 1, ($nb ? $nb : 10));
$this->context->smarty->assign(array( $this->context->smarty->assign(array(