Jump to content

show products from all categories


Recommended Posts

Hi, 

 

So i have below a piece of modified code from a modified homefeatured module. This code allows you to select if you want a certain category to be displayed in homefeatured and if you want random or not.

 

 

 

function hookHome($params)
{
global $smarty;
 
$cat = intval(Configuration::get('HOME_FEATURED_CATALOG2'));
$category = new Category($cat ? $cat : 60);
$nb = intval(Configuration::get('HOME_FEATURED_NBR2'));
if (intval(Configuration::get('HOME_FEATURED_RANDOM2'))) {
$products = $category->getProducts(intval($params['cookie']->id_lang), 1, ($nb ? $nb : 10), NULL, NULL, false, true, true, ($nb ? $nb : 10));
 
}
else {
$products =$category->getProducts(intval($params['cookie']->id_lang), 1, ($nb ? $nb : 10), 'date_upd', 'DESC');
}
 
$smarty->assign(array('products' => $products, 'homeSize' => Image::getSize('home')));
 
return $this->display(__FILE__, 'homefeaturez2.tpl');
}
}
 
 
if i change this function: 
 
$category = new Category($cat ? $cat : 60); 
 
i can modify the category the script pulls the products from. ex: 60, 61, 62 - that would be the category ID
 
But i want to know if it is possible to modify that function so it pulls products from all available categories, not just one. 
 
Help?
 
Link to comment
Share on other sites

×
×
  • Create New...