Code: Select all
<!-- Start - Code to link to main product - Put only once on page -->
<script type="text/javascript">
function gotomainproduct(){
var prodlink = '<actinic:variable name="SearchCGIURL" encoding="perl" selectable="false" />?PRODREF=<actinic:variable Name="ProductID" encoding="perl" selectable="false" />&NOLOGIN=1<actinic:block if="%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e">&SHOP=<actinic:variable name="ShopID" /></actinic:block>';
if (window.name == 'RelatedPopup') // Upsell in a popup window
{
if( opener )
{
opener.location.href = prodlink;
setTimeout('window.close()',1000);
return true;
}
else
{
alert('Cannot locate product page. Make sure the original product page is being displayed and try again.');
setTimeout('window.close()',1000);
return false;
}
}
else // Upsell in a Greybox
{
if( top.window )
{
top.window.location.href = prodlink;
setTimeout('window.close()',1000);
return true;
}
else
{
alert('Cannot locate product page. Make sure the original product page is being displayed and try again.');
setTimeout('window.close()',1000);
return false;
}
}
}
</script>
<!-- End - Code to link to main product - Put only once on page -->
<!-- Links to product - may be repeated if required -->
<a href="#" onclick="gotomainproduct();">See main product</a>
<input type="button" value="See main product" onclick="gotomainproduct();" />