Hi David,
after import I have a lot of products in the db that can't be matched with a product from an other merchant. It's the same product but the name is different from merchant to merchant and no EAN or gtin is supplied in a feed.
How would I delete automatically all products from the db that have no two prices to compare?
A price comparision without differnet prices to compare isn't looking too good :-)
Best
Sven
Hello Sven,
The following script will do the trick; save as scripts/purge.php, and you could chain it with your cron process to follow uidmap.php in the same way - let me know if you're not sure of course;
<?php
set_time_limit(0);
require("../includes/common.php");
$sql = "SELECT id,COUNT(id) AS numMerchants,name FROM `".$config_databaseTablePrefix."products` GROUP BY name HAVING numMerchants = 1";
if (database_querySelect($sql,$rows))
{
foreach($rows as $row)
{
$sql = "DELETE FROM `".$config_databaseTablePrefix."products` WHERE id='".$row["id"]."'";
database_queryModify($sql,$result);
}
}
print "Done.";
?>
Cheers,
David.
--
PriceTapestry.com