You are here:  » block of random products

Support Forum



block of random products

Submitted by rolli1 on Thu, 2012-03-29 15:29 in

Hi David,
on my page I display 8 random products. I want to expand that to 36 random products in 8 rows each row with 4 products in it. I tried a lot to get them into a block, but couldn't manage that.
Is there a way to do so?

Regards

Roland

Submitted by support on Thu, 2012-03-29 15:34

Hi Roland,

Have a look at the code in this thread for displaying Featured Products on 2 or more rows; so in your case you would use if ($count++ == 8)...

Cheers,
David.
--
PriceTapestry.com

Submitted by rolli1 on Thu, 2012-03-29 15:56

Hi David,
with this coding I get 4 blocks of 9 products each row.
What I want is to get 9 blocks with 4 products each row.

Regards

Roland

Submitted by support on Thu, 2012-03-29 16:03

Hi Roland,

In your version, replace:

  if ($count++ == 3)

with:

  if (!isset($count)) $count = 0;
  $count++;
  if ($count == 4)

...and that should give you 9 rows of 4...

Cheers,
David.
--
PriceTapestry.com

Submitted by rolli1 on Thu, 2012-03-29 16:28

Thanks very much....works perfect.

Roland