Hi David
Is it possible to disable the "Visit Store" button if the useragent is a bot like googlebot or bingbot etc..
hi again david
just tested on my website and it seems to always hide the links whatever the user agent is
Hi,
Sorry about that - the $agent parameter in the string comparison was missing - corrected above in this line;
if (stripos($_SERVER["HTTP_USER_AGENT"],$agent)!==FALSE)
Cheers,
David.
--
PriceTapestry.com
Sure - if you edit html/prices.php and first add the following code to the very top of the script:
<?php
$agents = array("googlebot","bingbot");
foreach($agents as $agent)
{
if (stripos($_SERVER["HTTP_USER_AGENT"],$agent)!==FALSE)
{
$hide = TRUE;
}
}
?>
With that in place, you can remove any content you don't want to be included by enclosing the HTML / code within the following IF construct:
<?php if (!isset($hide)):?>
...
<?php endif; ?>
So for the Visit Store button in the default template, look for the following code at line 76:
<td class='pt_pr_visit'><a class='button tiny radius success' href='<?php print tapestry_buyURL($product); ?>'><?php print translate("Visit Store"); ?></a></td>
...and REPLACE with:
<?php if (!isset($hide)):?>
<td class='pt_pr_visit'><a class='button tiny radius success' href='<?php print tapestry_buyURL($product); ?>'><?php print translate("Visit Store"); ?></a></td>
<?php else: ?>
<td> </td>
<?php endif; ?>
Cheers,
David.
--
PriceTapestry.com