Jump to content
PinnacleSupplies

Any PHP Experts out there?

Recommended Posts

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 by PinnacleSupplies (see edit history)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More