Hi!
I've consistantly noticed that the image and description that I pull up on my featured page (sorry, I modded the featured list to show descriptions before you say it shouldn't!) is different from that which is shown on the full product page.
Now, I'm sure i'm not alone in saying that some merchants give great pics and descriptions. and others don't.
Is there anyway that an option can be set as a "prefered feed" so that one particular merchants image/desc is chosen for everything before any other.. it'll help my site look a lot more uniform.
Many kinds regards, can't wait to upgrade to the latest version - continue the fantastic work :)
James
www.gamepriceuk.com
Cheers David,
Didn't work straight away, so I had a play..
The new SQL statement needs to be $sql2 I presume, as its called in the next row
database_querySelect($sql2,$rows2);
Also, doesn't $featured["products"] = $rows;
have to be at the end of the loop?, so to update the changes of the featured array?
Lastly, There are 2 semi-colons at the end of the SQL statement.. is that correct? I removed the inner one and it's still working ok. :)
Looks like it works now, thanks for your help - this vastly improves my frontpage no end, very much appreciated :) :)
James
www.gamepriceuk.com
Hi James,
You've got it - original corrected as described...
Cheers,
David.
--
PriceTapestry.com
Hi James,
As featured products are selected using a summary query there's no control over which actual product record the non-summary fields are chosen from; although it will always be consistent. What you need to do therefore is to requery after the initial Featured Products query to update the result set with the descriptions from your preferred merchants.
Where you currently have this code in your Featured Products section:
database_querySelect($sql,$rows);
$featured["products"] = $rows;
...REPLACE that with:
database_querySelect($sql,$rows);
$sql2 = "SELECT * FROM `".$config_databaseTablePrefix."products`
WHERE normalised_name IN (".$sqlIn.")";
database_querySelect($sql2,$rows2);
$merchantPriority = array("Merchant 1","Merchant 2","etc.");
foreach($rows2 as $row2)
{
foreach($merchantPriority as $merchant)
{
if ($row2["merchant"] == $merchant)
{
foreach($rows as $k => $row)
{
if ($row["normalised_name"] == $row2["normalised_name"])
{
$rows[$k]["description"] = $row2["description"];
$rows[$k]["image_url"] = $row2["image_url"];
break;
}
}
}
}
}
$featured["products"] = $rows;
Simply edit the $merchantPriority array to list preferred merchants for the use of descriptions / images as required. No need to list all merchants, just any that you would like to override other merchant's descriptions / images...
Cheers,
David.
--
PriceTapestry.com