Random items

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 anos atrás
Hi guys,

I have a fairly simple question. I would like to show four random products on the frontpage. All four products are discount products with a now and then price associated .. how can i do that?

Thanx in advance!
14 anos atrás
If you ask me how would I do it I would say to use existing display on homePage flag for product and integrate randomness in code. If hare are many products that you need to chose this 4 from then I'll consider to return 4 rows from database (there are more ways to do it).

Of course if you need something more complex like integrate equal number od displays for every prodict then you will need to add some more fields in database that will take care of numer of displays and so one. But that is different topic.
14 anos atrás
I have written a module that works on the home page. I just wrote a stored procedure that returns 4 random products.


SET NOCOUNT ON;

select top 4 ASIN from tblProducts Order by NewID()



I hope this helps.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.