Jump to content

Random products on homefeatured module


doubleb

Recommended Posts

Hello,

 

I try to add 12 random products on the homefeatured module (products from any category, not only those in the home category). I added a new select box in the module admin section with the name "HOME_RANDOM_CATEGORY" and once this is set to Yes I want to display those random products, if it's set to No the module works as it should by default.

 

Everything is working ok except this part:

if (Configuration::get('HOME_RANDOM_CATEGORY')) 
$category = new Category(43, (int)Context::getContext()->language->id);
else 
$category = new Category((int)Configuration::get('HOME_FEATURED_CAT'), (int)Context::getContext()->language->id);

I used '43' only for testing because I don't know how to select all categories at the same time so I can extract the products randomly.

 

I could use some help here :)

 

Thank you!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...