When I import a new feed some product aren’t mapped (because the product is renamed for example). And it’s a bit difficult to see if it should be when a check all the product from the merchant.
Do you know if there is a way to add a « Mapped » flag near each product name on the merchant products page to easily see which product is mapped and which isn’t?
Thanks
Yes! that's exactly what I need. It works great.
Thanks
Hello Klyde,
As the mapping is applied during import there is nothing in the database that would be able to identify mapped or otherwise products on the search results (i.e. for a merchant search).
One possibility would be to add a debug option to search.php to read the mapping database and flag all mapped products, perhaps by prefixing an [M] to the description. To do this, look for the following code at the top of search.php:
require("includes/common.php");
...and INSERT this new code on the next line:
if ($_GET["map"])
{
$sql = "SELECT name FROM `".$config_databaseTablePrefix."productsmap`";
if (database_querySelect($sql,$rows))
{
$mapped = array();
foreach($rows as $row)
{
$mapped[$row["name"]] = 1;
}
}
}
Then, towards the end look for this code (line 164 in the distribution):
foreach($searchresults["products"] as $k => $product)
{
...and INSERT this new code on the next line (inside the foreach structure)
if ($_GET["map"])
{
if ($mapped[$product["name"]])
{
$searchresults["products"][$k]["description"] = "[M]".$searchresults["products"][$k]["description"];
}
}
You can then reveal the mapping by visiting a merchant search results page and adding the &map=1 parameter, for example:
http://www.example.com/search.php?q=merchant:Some Merchant&map=1
Hope this helps!
Cheers,
David.