I was wondering if someone can point me in the right direction when it comes to display x amount of home page featured products randomly on the homepage.
I have looked in the source code and am trying to get my head around it at the moment.
You can run this script, to put into a stopeprocedure and run it at time interval you like. The advantage is that it shows only products in stock, so there's no risk a customer enter a product pageand discover it's sold out.
set @inum = 0; select @min=min(id), @max=max(id) from product; select @max=@max-@min+1;
declare @tID table(ID int); set nocount on;
while @inum < 10 begin set @ID = rand() * @max + @min; select @ID = case ProductTypeId when 5 then ParentGroupedProductId when 10 then Id end from Product where ID=@ID if not Exists(select * from @tID where id=@ID) begin if exists( select * from product where id=@id AND Deleted = 0 AND published = 1) if (select SUM(StockQuantity) from Product where Id=@ID)> 0 begin insert into @tID Values(@id); set @inum = @inum + 1; end end end
update product set ShowOnHomePage = 0;
update product set ShowOnHomePage = 1 from product t1 inner join @tID q on t1.ID = q.id;