0

I have seen multiple posts about random products here ... But mine is a bit different.

What i would like to to do:

Day one: Lets say 8 .... (could change later on) random products selected from multiple categories (max 6 different categories) For example with the following id's 7, 34, 76, 81, 83 and 92

But when 8 products are choosen the should remain all day ... and don't be reloaded when you hit refresh.

Day two: 8 new random products selected from other categories, for example 9,15,22,45,78,82

And so on ... Untill about 7-8 days ... and than restart from day one but with different products.

And it must be a automatic process. Is this even possible?

And if possible ... where should i start ...

1

I can offer following way:

Create new category 'Featured Products'. Then just show this category on page you like, with your products.

Now you just need to assign products on this category. I can offer you do it by cron in new php file. You can run this script with any schedule.

Firstly you unassign all products from this category, then you need to assign new.

1

Yes, it is possible. Assuming the other posts provided an answer for the part about selecting products from a list of categories, all you need to do is seed your RNG with a distinct value for the day. So for the example of using PHP’s mt_rand() you would first seed it with something like this: mt_srand(date('Ymd')).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.