You are here:  » Featured Products in 2 or More Rows


Featured Products in 2 or More Rows

Submitted by srl2112 on Sun, 2006-05-14 20:32 in

Is there a modificaton to set the featured items into 2 or more rows?

Thnaks - Steve

Submitted by support on Mon, 2006-05-15 06:58

Hi Steve,

The easiest way is to increment a counter, and output the HTML to start a new table row whenever it reaches the number of products you want in each row.

In html/featured.php, find the following code:

        </td>
      <?php endforeach; ?>

That's where each product cell is closed. You need to insert the code to start a new row between these 2 lines, as follows, so the whole section will look like this:

        </td>
        <?php
        if (!isset($count)) $count = 0;
        $count++;
        if ($count == 3)
        {
          print "</tr><tr>";
          $count = 0;
        }
        ?>
      <?php endforeach; ?>

Simply change the number 3 in the above code if you want more or less products per row...

Cheers,
David.

Submitted by srl2112 on Mon, 2006-05-15 08:26

Perfect...Thanks David

Submitted by Gobbo on Fri, 2012-07-13 14:42

Hi David,

The above does not seem to work correctly.

How do I make it show 3 lines of 4 products on each line?

Submitted by support on Fri, 2012-07-13 14:50

Hi Gobbo,

Within the above code use:

    if ($count == 4)

...and make sure that you have 12 Featured Products configured - that should do it!

If the layout still doesn't look correct; email me your modified html/featured.php and I'll check it out for you...

Cheers,
David.
--
PriceTapestry.com

Submitted by Gobbo on Fri, 2012-07-13 15:08

Done it, forgot to go into index.php to change the qty.