Hi,
The reviews are now connected to the product names, is it possible to change it to the model in my case.
Thx Henk
Hi David,
it works half, the input into table products field reviews and rating doesnt work anymore.
So the counting also.
Thx HEnk
Hi Henk,
To update the count, find the following line in includes/admin.php inside the admin_importReviews() function (line 422):
$sql = "UPDATE `".$config_databaseTablePrefix."products` SET rating='".$review["rating"]."',reviews='".$review["reviews"]."' WHERE name='".database_safe($review["product_name"])."'";
Change this as follows:
$sql = "UPDATE `".$config_databaseTablePrefix."products` SET rating='".$review["rating"]."',reviews='".$review["reviews"]."' WHERE model='".database_safe($review["product_name"])."'";
That will update the review and rating count based on model number, not product name.
Cheers,
David.
Hi,
There is no built in code for merchant review at this time. Other users have requested this functionality in the past so it is on my list of feature requests but at the time I do not have a timescale for any updated version of this script...
Cheers,
David.
Hi Henk,
This is quite a complex modification, but to start with, you would need to change the links to the review page in the URLs on the homepage and the product page.
In index.php you need the following changes:
Line 57:
$featured["products"][$k]["reviewHREF"] = "review/".tapestry_hyphenate($product["name"]).".html";
change to:
$featured["products"][$k]["reviewHREF"] = "review/".tapestry_hyphenate($product["model"]).".html";
Line 63:
$featured["products"][$k]["reviewHREF"] = "reviews.php?q=".urlencode($product["model"]);
change to:
$featured["products"][$k]["reviewHREF"] = "reviews.php?q=".urlencode($product["model"]);
And in products.php
Line 24:
$rows[$k]["reviewHREF"] = "../review/".tapestry_hyphenate($row["name"]).".html";
change to:
$rows[$k]["reviewHREF"] = "../review/".tapestry_hyphenate($row["model"]).".html";
Line 30:
$rows[$k]["reviewHREF"] = "reviews.php?q=".urlencode($row["name"]);
change to:
$rows[$k]["reviewHREF"] = "reviews.php?q=".urlencode($row["model"]);
Then in reviews.php, you need to change the SQL to select model rather than product name. On line 34 you will see the following code:
$sql = "SELECT * FROM `".$config_databaseTablePrefix."products` WHERE name = '".database_safe($q)."' ORDER BY price LIMIT ".$config_resultsPerPage;
change this to:
$sql = "SELECT * FROM `".$config_databaseTablePrefix."products` WHERE model = '".database_safe($q)."' ORDER BY price LIMIT ".$config_resultsPerPage;
Hope this helps,
Cheers,
David.