Hi David
Was wondering if this is possible
is there anyway that all products that are being filtered through the product map could automatically forward links to the new product name item
eg.
google organic sends web user to
{link saved}
but due to product mapping the product page no longer exists and in the product mapping page the new product name should see the user compare product prices at
{link saved}
is this possible?
thanks for your time
phil
Hi David
Just wondering can this be changed to work for exact matches also?
regards
Phil Stone
www.buy24-7.net
Hi Paul,
It's using LIKE with wildcards (%) before and after so it should work for exact matches as it stands above...
Cheers,
David.
--
PriceTapestry.com
Hi David, trying to get this working in the new script to auto redirect where a product name has been removed to become part of a product mapping
eg so unmapped.html redirects to mapped.html
for some reason i just get a blank screen, and also the /product/ seems to be removed?
regards
Phil Stone
www.buy24-7.net
Hello Phil,
Have a go with the following as the replacement which will select the full new product record and use the tapestry_productHREF() function to get the new URL...
$sql = "SELECT * FROM `".$config_databaseTablePrefix."productsmap` WHERE alternates LIKE '%".database_safe($q)."%' LIMIT 1";
if (database_querySelect($sql,$rows))
{
$sql = "SELECT * FROM `".$config_databaseTablePrefix."products` WHERE name = '".database_safe($rows[0]["name"])."' LIMIT 1";
if (database_querySelect($sql,$rows))
{
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".tapestry_productHREF($rows[0]));
exit();
}
}
$banner["h2"] .= "(".translate("product not found").")";
Cheers,
David.
--
PriceTapestry.com
Hi Phil,
Should be straight forward by checking the product mapping table as part of the "not found" handling. In products.php, look for the following code around about line 58:
$banner["h2"] .= "(".translate("product not found").")";
...and REPLACE this with:
$sql = "SELECT * FROM `".$config_databaseTablePrefix."productsmap` WHERE alternates LIKE '%".database_safe($q)."%' LIMIT 1";
if (database_querySelect($sql,$rows))
{
header("HTTP/1.1 301 Moved Permanently");
header("Location: /".tapestry_hyphenate($rows[0]["name"]).".html");
exit();
}
$banner["h2"] .= "(".translate("product not found").")";
Cheers,
David.