You are here:  » Featured Products above search with 2 rows and 8 items


Featured Products above search with 2 rows and 8 items

Submitted by hansi on Wed, 2006-11-22 02:33 in

Hello,

how can I make "Featured Products" like here:
http://www.shoppingchanneluk.com/

Thanks!

Best regards,
Hani

Submitted by support on Wed, 2006-11-22 09:11

Hello Hani,

Instructions for converting the featured products into rows are here:

http://www.pricetapestry.com/node/284

If you want to display the featured products above the search box, you just need to move the code around slightly in index.php To find the section of code you need to move, look for:

require("html/searchform.php");

..and move that, together with the next block of code until the following line:

print javascript_focus("search.q");

(line 30) down the script and insert it back in after the following code:

if (isset($featured)) require("html/featured.php");

That will then make the search box appear below the featured products.

Cheers,
David.

Submitted by hansi on Thu, 2006-11-23 00:18

Hello David,

I made 3 colums...
1. for navigation oon the left site,
2. the center for the searchform
3. for adsense

itlooks good but today I get this:

Fatal error: Cannot redeclare database_queryselect() (previously declared in /var/www/web42/html/compare/includes/database.php:3) in /var/www/web42/html/compare/includes/database.php on line 3

Do you know what could cause this error?

Submitted by hansi on Thu, 2006-11-23 00:21

Hi,

ok the error disappers, if I remove this from the center:

<?php
  
require("config.php");
  require(
"includes/database.php");
  
$sql "SELECT count(*) as numProducts FROM `".$config_databaseTablePrefix."products`";
  
database_querySelect($sql,$rows);
  
$numProducts $rows[0]["numProducts"];
  print 
"<p>Total products in database: ".$numProducts."</p>";
?>

Submitted by support on Thu, 2006-11-23 08:03

Hello Hani,

You are getting a redeclaration error because the include files are being called in twice when you use this code. Because the files (config.php and includes/database.php) have already been included, all you need to use is:

<?php
  $sql 
"SELECT count(*) as numProducts FROM `".$config_databaseTablePrefix."products`";
  
database_querySelect($sql,$rows);
  
$numProducts $rows[0]["numProducts"];
  print 
"<p>Total products in database: ".$numProducts."</p>";
?>

Cheers,
David