i tried many solutions but nothing worked, here is my code if someone could help me
public function hookDisplayHome($params)
{
if (!$this->isCached('homefeatured_mod.tpl', $this->getCacheId('homefeatured_mod')))
{
$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));
if(method_exists('Product','getProductsImgs'))
{
$image_array=array();
for($i=0;$i<count($products);$i++)
{
if(isset($products[$i]['id_product']))
$image_array[$products[$i]['id_product']]= Product::getProductsImgs($products[$i]['id_product']);
}
$this->smarty->assign('productimg',(isset($image_array) AND $image_array) ? $image_array : NULL);
}
$this->smarty->assign(array(
'products' => $products,
'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'),
'homeSize' => Image::getSize(ImageType::getFormatedName('home')),
));
}
return $this->display(__FILE__, 'homefeatured_mod.tpl', $this->getCacheId('homefeatured_mod'));
}
public function hookAddProduct($params)
{
$this->_clearCache('homefeatured_mod.tpl');
}