Bonjour,
Quelqu'un aurait il une idée comment faire les produits phares aléatoires sur la version de prestashop 1.6.
Sur la 1.5 ce code marche mais pas sur la 1.6
$products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 10),NULL,NULL,false,true,true,($nb ? $nb : 50));
Voici le code à modifier :
public function _cacheProducts()
{
if (!isset(HomeFeatured::$cache_products))
{
$category = new Category(Context::getContext()->shop->getCategory(), (int)Context::getContext()->language->id);
$nb = (int)Configuration::get('HOME_FEATURED_NBR');
HomeFeatured::$cache_products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), 'position');
}
if (HomeFeatured::$cache_products === false || empty(HomeFeatured::$cache_products))
return false;
}
Merci par avance ..