venerdì 7 dicembre 2012

Random products in prestashop 1.4

In productcategory.php change:


$categoryProducts = $category->getProducts((int)($cookie->id_lang), 1, 100);

to be


$categoryProducts = $category->getProducts(intval($params['cookie']->id_lang), 1, 100);
if ($categoryProducts) {
shuffle($categoryProducts);
array_splice($categoryProducts, ($nb ? $nb : 10));
}

Nessun commento:

Posta un commento