Hi David,
A strange thing is happening with a mod showing last reviews (already posted somewhere on this forum). I have the following code :
{code saved}
The problem is I can't get the product image next to each review (in fact there is always the same one, the "noimage.jpg") . And very strange, only one product has an thumbnail (the second product in the list !?!), but this is not the right one : this is the image of the last product in the search result column. I suspect a cache problem or something like this, but...
Any help would be appreciated.
Thanks
Bak
Thanks David,
This time, I get an image for each review, but this is not the right one, and it's always the same (in fact, it's this time again the image of the last product from the search result...).
Hello Bak,
Ah - reviews are actually indexed by normalised_name so in your code, where you currently have:
$sql2 = "SELECT image_url FROM `".$config_databaseTablePrefix."products` WHERE name='".database_safe($review["product_name"])."' AND image_url <> '' LIMIT 1";
database_querySelect($sql2,$rows2);
$review["image_url"] = $rows2[0]["image_url"];
...REPLACE this with:
$sql2 = "SELECT image_url FROM `".$config_databaseTablePrefix."products` WHERE normalised_name='".database_safe($review["product_name"])."' AND image_url <> '' LIMIT 1";
if (database_querySelect($sql2,$rows2))
{
$review["image_url"] = $rows2[0]["image_url"];
}
else
{
$review["image_url"] = "";
}
Cheers,
David.
--
PriceTapestry.com