PinnacleSupplies 0 Posted August 8, 2012 Posted August 8, 2012 (edited) Can anyone help with what may be a simple PHP task? I need help with a small piece of code, see below $category = new Category([color=#ff0000][b]1[/b][/color], Configuration::get('PS_LANG_DEFAULT')); //if ($category) { //shuffle($category); $nb = (int)(Configuration::get('HOME_FEATURED_NBR')); $products = $category->getProducts((int)($params['cookie']->id_lang), 1, ($nb ? $nb : 10)); if ($products) { shuffle($products); array_splice($products, ($nb ? $nb : 10)); } $smarty->assign(array( 'products' => $products, 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'homeSize' => Image::getSize('home'))); I need to change the above item marked in red to a random category instead of a 1, is this possible please? Cheers Edit, oops, it didnt seem to work as I thought, the line needing changed is in the first line and the first number 1 in it. Thanks Edited August 8, 2012 by PinnacleSupplies (see edit history) Share this post Link to post Share on other sites
Recommended Posts