Submitted by mikecdprice on Thu, 2011-09-15 16:52 in Price Tapestry
Hwllo,
Is there a way to have a script that would scan the product names and sort them on a report in cluster groups to show possible duplicate products that should be consolidated into product mapping?
I know you're running a niche site so the following should be viable - it will simply output a complete list of unique product names with the number of merchants in brackets, ordered by name so that you can see possible candidates for mapping (for the least work you could of course take the name with the most merchants as your master name which would mean they don't need to be entered in the mapping)
test.php
<?php require("includes/common.php"); header("Content-Type: text/plain"); $sql = "SELECT name,COUNT(id) AS numMerchants FROM `".$config_databaseTablePrefix."products` GROUP BY name ORDER BY name"; database_querySelect($sql,$rows); foreach($rows as $row) print $row["name"]." (".$row["numMerchants"].")\n"; ?>
Hi Michael,
I know you're running a niche site so the following should be viable - it will simply output a complete list of unique product names with the number of merchants in brackets, ordered by name so that you can see possible candidates for mapping (for the least work you could of course take the name with the most merchants as your master name which would mean they don't need to be entered in the mapping)
test.php
<?php
require("includes/common.php");
header("Content-Type: text/plain");
$sql = "SELECT name,COUNT(id) AS numMerchants FROM `".$config_databaseTablePrefix."products` GROUP BY name ORDER BY name";
database_querySelect($sql,$rows);
foreach($rows as $row) print $row["name"]." (".$row["numMerchants"].")\n";
?>
Cheers,
David.
--
PriceTapestry.com