Hi david
I am looking to put a visit store under the more info link on the search results page,is it possible, I am aware there could be a issue if there is more than one company.
Brent
Hi David
that worked great, one more thing regarding sending people to the merchant, could a link for this be put into the rss.php also.
Thanks
brent
Hi Brent,
Sure, could you post your current rss.php and let me know how / where you want the link within the feed - i.e. do you want it to replace the link to your Price Tapestry site; or alternatively include it as part of the description etc...
Cheers,
David.
Hi david
I would like it after the description if possible as a separate link.
Brent
<?php
$baseURL = "url"; // URL of your site without trailing "/"
require("includes/common.php");
header("Content-Type: text/xml");
print "<?xml version='1.0' encoding='UTF-8'?>";
print "<rss version='2.0'>";
print "<channel>";
print "<title>RSS Feed</title>";
print "<link>".$baseURL.$config_baseHREF."</link>";
print "<description>RSS Feed</description>";
if ($_GET["merchant"]) { $where = " WHERE merchant='".database_safe($_GET["merchant"])."' "; }
elseif ($_GET["category"]) { $where = " WHERE category='".database_safe($_GET["category"])."' "; }
elseif ($_GET["brand"]) { $where = " WHERE brand='".database_safe($_GET["brand"])."' "; }
else { $where = ""; }
$sql = "SELECT * FROM `".$config_databaseTablePrefix."products` ".$where." ORDER BY RAND() LIMIT 20";
if (database_querySelect($sql,$rows))
{
foreach($rows as $product)
{
print "<item>";
if ($config_useRewrite)
{
$href = "product/".tapestry_hyphenate($product["name"]).".html";
}
else
{
$href = "products.php?q=".urlencode($product["name"]);
}
print "<title>".$product["name"]."</title>";
print "<link>".$baseURL.$config_baseHREF.$href."</link>";
print "<guid>".$baseURL.$config_baseHREF.$href."</guid>";
print "<description><![CDATA[";
print "<img src='".$product["image_url"]."' /><br />";
print "<p>".$product["description"]."</p>";
print "]]></description>";
print "</item>";
}
}
print "</channel>";
print "</rss>";
?>
Hi Brent,
To do that, replace this line:
print "<img src='".$product["image_url"]."' /><br />";
...with:
print "<img src='".$product["image_url"]."' /><br />";
print "<a href='".tapestry_buyURL($product)."'>Visit Store</a>";
Cheers,
David.
Hi Brent,
This can easily be added in html/searchresults.php. To only show the Visit Store link if there is only one merchant, look for the following closing endif; statement on line 30:
<?php endif; ?>
...and REPLACE that with:
<br /><a href='<?php print tapestry_buyURL($product); ?>'>Visit Store</a>
<?php endif; ?>
Alternatively, to have it displayed in both cases (either 1 or more merchants), just add the code on the line after the endif; statement instead...
Cheers,
David.