You are here:  » Modified Featured Page

Support Forum



Modified Featured Page

Submitted by thelegacy on Sun, 2009-01-25 23:17 in

Hi David,

I have a modified featured page, but I am having some troubles implementing the interaction coding to it, think you could help out here. I'm adding my custom feature page code here so you can see what I have so far. I am including this from the /html/ folder into index.php.

<div class='featured'>
  <table width='630' cellspacing='3'>
  <th colspan='4'><?php print translate("Featured Products from MyMerchant1 and MyMerchant2"); ?></th>
<?php
  $products_per_row = 4;
  $products = 4;
  $coloum_cnt = 0;
   $sql = "SELECT * FROM `".$config_databaseTablePrefix."products` WHERE (merchant='MyMerchant1' OR merchant='MyMerchant2') ORDER BY RAND() LIMIT 4";
  database_querySelect($sql,$products);
  if($coloum_cnt ==0)
  print "<tr>";
  foreach($products as $product)
  {
  if ($product["image_url"])
  if ($config_useRewrite)
  {
     $productHREF = "../product/".tapestry_hyphenate($product["name"]).".html";
$reviewHREF = "../review/".tapestry_hyphenate($product["name"]).".html";
  }
   else
  {
    $productHREF = "products.php?q=".urlencode($product["name"]);
    $reviewHREF = "reviews.php?q=".urlencode($product["name"]);
  }
  print "<td style='background-color:#ffffff; border: 2px dotted #00753a; text-align:center; width:25%; padding:3px;' valign='top'><a href='".$productHREF."'><img src='".$product["image_url"]."' alt='".$product["name"]."' border='0' /></a><p><a href='".$productHREF."'>".$product["name"]."</a><br /><strong>Price:</strong> ".$config_currencyHTML.$product["price"]."</strong><br /><a href='".$productHREF."'>Product Details</a></p>";
  print "</td>";
  $coloum_cnt++;
  if($coloum_cnt == $products_per_row){
  $coloum_cnt = 0;
  print "</tr>";
  }
}
?>
</table>
</div>

Thanks in advance :>)

Submitted by support on Mon, 2009-01-26 09:15

Hi,

It sounds like you want to make use of the $reviewHREF variable on this line:

print "<td style='background-color:#ffffff; border: 2px dotted #00753a; text-align:center; width:25%; padding:3px;' valign='top'><a href='".$productHREF."'><img src='".$product["image_url"]."' alt='".$product["name"]."' border='0' /></a><p><a href='".$productHREF."'>".$product["name"]."</a><br /><strong>Price:</strong> ".$config_currencyHTML.$product["price"]."</strong><br /><a href='".$productHREF."'>Product Details</a></p>";

...so try something like this:

print "<td style='background-color:#ffffff; border: 2px dotted #00753a; text-align:center; width:25%; padding:3px;' valign='top'><a href='".$productHREF."'><img src='".$product["image_url"]."' alt='".$product["name"]."' border='0' /></a><p><a href='".$productHREF."'>".$product["name"]."</a><br /><strong>Price:</strong> ".$config_currencyHTML.$product["price"]."</strong><br /><a href='".$productHREF."'>Product Details</a> | <a href='".$reviewHREF."'>Reviews</a></p>";

Hope this helps!
Cheers,
David.

Submitted by thelegacy on Fri, 2009-01-30 02:50

Yes, that was it David, thank you! Sorry about the delay on the reply, we just went through an ice storm here.

MeadorLtd Web-Properties
--------------------------
www.shopathomecafe.com
www.asseenontv-shop.com
www.smarter-shoppers.com
www.cafepress-search.com
www.absolutely-free-money.com