You are here:  » featured products


featured products

Submitted by searley on Wed, 2006-03-29 12:22 in

What would be the best way to have 2 sets of featured products on the front page??

Submitted by support on Wed, 2006-03-29 17:21

Do you actually want 2 distinct sets of products, or just to split the featured products onto multiple rows?

Submitted by searley on Wed, 2006-03-29 19:19

I was thinking spliting the products onto multiple rows BUT

take a look at the homepage at www.shoppingchanneluk.com the second row of products i have setup to select products from 'Featured Merchants' and will randomly select the products

I have figured out how to add reviews, and toggle to stars if reviews exist

what i can not figure out is how to add the price, and toggle to a from price if the products is carried by multiple merchants

if it helps here is the code i have used so far:

print "<table width='100%' border='0' cellspacing='5' cellpadding='0'>";
print "<tr>";
$sql = "SELECT * FROM `".$config_databaseTablePrefix."products` WHERE merchant = 'Cadbury Gifts Direct' OR merchant='comet' OR merchant='24 Electric' ORDER BY RAND() LIMIT 4";
database_querySelect($sql,$products);
foreach($products as $product)
{
  if ($product["image_url"])
  {
    $productHREF = $config_baseHREF."product/".str_replace(" ","-",$product["name"]).".html";
    print "<td align='center'>";
    print "<a href='".$productHREF."' ><img width='80' border=0 src='".$product["image_url"]."' alt='".$product["name"] ."' /></a><br>";
    print "<font size=2> <a href='".$productHREF."'> ".$product["name"]."</a><br>";
//print $config_currencyHTML.$product["price"]." <br /></font>\n";
?>
<small><br>
            <?php if ($product["reviews"]): ?>
      <?php print tapestry_stars($product["rating"],"s"); ?>&nbsp;
              <a href='<?php print "review/".tapestry_hyphenate($product["name"]).".html"?>'><?php print $product["reviews"]." ".translate("Reviews"); ?></a>
            <?php else: ?>
              <a href='<?php print "review/".tapestry_hyphenate($product["name"]).".html"?>'><?php print translate("Review This Product"); ?></a>
            <?php endif; ?>
            </small><br>
<?php
    print "</td>";
  }
  else
  {
    print "<td>&nbsp;</td>";
  }
}
print "</tr>";
print "</table>";

Submitted by atman on Mon, 2006-09-18 14:34

hi searley,

this is a good mod. i tried it on the latest version of PT buit nothing seems to be happening.

is this compatible with the latest release?

this can be a seperate mod something like "random products"

regards,

atman

Submitted by support on Mon, 2006-09-18 14:51

Hi atman,

If you're seeing nothing it probably means that there were no rows returned by the query, so you need to investigate the SQL.

To debug this, instead of just:

database_querySelect($sql,$products);

use...

$numRows = database_querySelect($sql,$products);
print "Featured Products matched ".$numRows." rows using SQL: ".$sql;

If that shows 0 products, look at the merchant names and verify that they really are in your database...

Cheers,
David.

Submitted by atman on Mon, 2006-09-18 17:18

david,

ok :) working now.

thank you.

atman