You are here:  » 1 Day on, comments please


1 Day on, comments please

Submitted by arthuc01 on Fri, 2006-02-10 14:31 in

Hi Guys

Well i've been fiddling with PT for the past day and I'd like your comments & suggestions if you don't mind...

Price comparison">Now3K >> Price comparison

Thanks in advance

Chris
PS: Dave have you thought about a "design" forum?
PPS: Theres only 2 threads set at the moment...more to be added this afternoon

Submitted by searley on Fri, 2006-02-10 14:36

Good,

My inition thoughts would be to put the google adwords at the bottom of the page, as i think you would risk people leaving your site via an ad word getting just a few cents, and not even looking to see if the product they want is listed below where they you could make more, then if the product is not there, they may click an adword

one other thinh you are missing a line break between the title and description

and will be much better once there is some form of category based search, but not much you can do about that at this stage

Submitted by henk on Fri, 2006-02-10 14:39

Browse all our merchants link doesnt work

Henk

Submitted by support on Fri, 2006-02-10 14:45

Looks good! Design has never been my strong point tho'!

As Henk says; something not right about your all merchants search - have you accidentally setup an infinate loop in .htaccess or something...?

Submitted by arthuc01 on Fri, 2006-02-10 14:58

Hav efixed the merchant page link...very odd not sure what happened there hmmm...

Anyone else agree with searly on the adwords thing?

Submitted by Eddie on Fri, 2006-02-10 14:59

Yup - at the bottom mate (doesnt look so "pushy")

Submitted by support on Fri, 2006-02-10 15:01

I prefer advertising at the bottom.

My theory being; if somebody has not found what they're looking for on your page then you have the chance of a click as the person works their way down the page. With ads at the top; the visitor will very quickly scan over them; and if they don't find what they're looking for may automatically go straight for the BACK button almost instinctively, without stopping to look at the ads _again_ on the way back up...

(I think that's sort of what searley said)

Submitted by madstock on Fri, 2006-02-10 15:04

I like the colour scheme very much - would you possibly be kind enough to share as to how you have incorporated the random rotating products on the front page please?

Submitted by Eddie on Fri, 2006-02-10 15:08

David

i think this random content unit is something you shoud add tot eh ever growing list so that it can be defined in:

layout (number of results)
Merchant (only show from one merchant)
Product (only show single product - like afalse best seller)

Submitted by arthuc01 on Fri, 2006-02-10 15:22

I'm not very good at PHP so how i di it was to call the following for each instance of the random item...

<?php
 
    srand
((double)microtime()*1000000);
    
$random=rand(2,$num_rows);
    
$sql "SELECT * FROM `".$config_databaseTablePrefix."products` WHERE id=$random";
    
$result mysql_query($sql,$link);
    
$product mysql_fetch_assoc($result);
    
$productHREF $config_baseHREF."product/".str_replace(" ","-",$product["name"]).".html";
            if (
$product["image_url"])
        {
          print 
"<a href='".$productHREF."'>";
          print 
"<img width='140' src='".$product["image_url"]."' alt='' /></a><br />\n";
        }
        else
        {
          print 
"<a href='".$productHREF."'>";
          print 
"<img width='140' src='images/broken.gif' alt='' /></a><br />\n";
        }
    print 
"<a href='".$productHREF."'>".$product["name"]."</a><br />\n";
    print 
$config_currencyHTML.$product["price"]." from <a href='".$product["buy_url"]."'>".$product["merchant"]."</a><br />\n";
?>

I'm sure theres a neater and not quite so memory intensive way of doing this so if anyone can tell me i'd be grateful

Submitted by arthuc01 on Fri, 2006-02-10 15:24

to do random items from a particular merchant should be as simple as changing the sql query to dictate what merchant you want

Submitted by arthuc01 on Fri, 2006-02-10 15:25

as for showing a single product you could just call its id

Submitted by support on Fri, 2006-02-10 15:31

You can select n random products (6 in this example) using some SQL like this:

<?php
$sql 
"SELECT * FROM `".$config_databaseTablePrefix."products` ORDER BY RAND() LIMIT 6";
database_querySelect($sql,$products);
foreach(
$products as $product)
{
  
// display product here using variables like $product["name"]
  // see product table definition in database.sql for field names
  // or copy the code in search.php that displays each product....
}
?>

(don't forget that includes/database.php isn't included on index.php as it stands in the distribution)

Submitted by arthuc01 on Fri, 2006-02-10 15:32

i knew there'd be an easier way :-)

Submitted by Eddie on Fri, 2006-02-10 15:59

UG... my PHP is just a tad naf (as David will tell ya)

Where am I going wrong ......

<?php
$sql 
"SELECT * FROM `".$config_databaseTablePrefix."products` ORDER BY RAND() LIMIT 4";
database_querySelect($sql,$products);
foreach(
$products as $product)
{
        if (
$product["image_url"])
        {
    print 
"<table width='100%'  border='0' cellspacing='5' cellpadding='0'>";
      print 
"<tr>";
    print 
"<td align='center'>";
    print 
"<img width='80' src='".$product["image_url"]."' alt='' />";
    print 
"<p class='mini'><a href='".$productHREF."'>".$product["name"]."</a></hp>";
    print 
"</td>";
    print 
"<td align='center'>";
    print 
"<img width='80' src='".$product["image_url"]."' alt='' />";
    print 
"<p class='mini'><a href='".$productHREF."'>".$product["name"]."</a></hp>";
    print 
"</td>";
    print 
"</tr>";
    print 
"<tr>";
    print 
"<td align='center'>";
    print 
"<img width='80' src='".$product["image_url"]."' alt='' />";
    print 
"<p class='mini'><a href='".$productHREF."'>".$product["name"]."</a></hp>";
    print 
"</td>";
    print 
"<td align='center'>";
    print 
"<img width='80' src='".$product["image_url"]."' alt='' />";
    print 
"<p class='mini'><a href='".$productHREF."'>".$product["name"]."</a></hp>";
    print 
"</td>";
    print 
"</tr>";
     print 
"</table>";
        }
        else
        {
          print 
"&nbsp;";
        }
  
// display product here using variables like $product["name"]
  // see product table definition in database.sql for field names
  // or copy the code in search.php that displays each product....
}
?>

Submitted by support on Fri, 2006-02-10 16:01

Hi Eddie;

You need to loop through each product; your code as it stands will just display each product 4 times (PHP foreach docs)

You also don't seem to be constructing $productHREF anywhere. You need something like this within the loop (assuming that you're using mod_rewrite):

$productHREF = $config_baseHREF."product/".str_replace(" ","-",$product["name"]).".html";

Submitted by Eddie on Fri, 2006-02-10 16:08

Missed that all together!

corrected to :

<?php
$sql 
"SELECT * FROM `".$config_databaseTablePrefix."products` 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 
"<table width='100%'  border='0' cellspacing='5' cellpadding='0'>";
      print 
"<tr>";
    print 
"<td align='center'>";
    print 
"<img width='80' src='".$product["image_url"]."' alt='' />";
    print 
"<p class='mini'><a href='".$productHREF."'>".$product["name"]."</a></hp>";
    print 
"</td>";
    print 
"<td align='center'>";
    print 
"<img width='80' src='".$product["image_url"]."' alt='' />";
    print 
"<p class='mini'><a href='".$productHREF."'>".$product["name"]."</a></hp>";
    print 
"</td>";
    print 
"</tr>";
    print 
"<tr>";
    print 
"<td align='center'>";
    print 
"<img width='80' src='".$product["image_url"]."' alt='' />";
    print 
"<p class='mini'><a href='".$productHREF."'>".$product["name"]."</a></hp>";
    print 
"</td>";
    print 
"<td align='center'>";
    print 
"<img width='80' src='".$product["image_url"]."' alt='' />";
    print 
"<p class='mini'><a href='".$productHREF."'>".$product["name"]."</a></hp>";
    print 
"</td>";
    print 
"</tr>";
     print 
"</table>";
        }
        else
        {
          print 
"&nbsp;";
        }
  
// display product here using variables like $product["name"]
  // see product table definition in database.sql for field names
  // or copy the code in search.php that displays each product....
}
?>

The problem was with the results being displayed 4 times !

see : http://www.ukmp3.co.uk/mp3players_compare/

Submitted by support on Fri, 2006-02-10 16:10

<?php
print "<table width='100%'  border='0' cellspacing='5' cellpadding='0'>";
print 
"<tr>";
$sql "SELECT * FROM `".$config_databaseTablePrefix."products` 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 
"<img width='80' src='".$product["image_url"]."' alt='' />";
    print 
"<p class='mini'><a href='".$productHREF."'>".$product["name"]."</a></p>";
    print 
"</td>";
  }
  else
  {
    print 
"<td>&nbsp;</td>";
  }
}
print 
"</tr>";
print 
"</table>";
?>

Submitted by searley on Fri, 2006-02-10 16:12

its a loop that runs 4 times by the sql statement

and you have 4 lots of products set up in the html

so whatever html you have in the loop will run 4 times

just create 1, and it will loop

Submitted by Eddie on Fri, 2006-02-10 16:20

TY all

TY David - got it now

Submitted by madstock on Fri, 2006-02-10 16:33

Thanks very much, that works a treat.