Following on from this KB article
http://community.actinic.com/showthread.php?t=45371
I have implemented the XE currency converter to go in a product layout with a 'show/hide' arrangement. It works with more than one product on a page.
It throws up an error in preview I guess because of the <actinic:variable name="ProductID" /> in the javascript. When uploaded this becomes just a number of course. Perhaps wrap the javascript in a "IsPreviewMode == False" Blockif.
Posted without any warranty or assurance just in case anyone else finds it useful.
http://community.actinic.com/showthread.php?t=45371
I have implemented the XE currency converter to go in a product layout with a 'show/hide' arrangement. It works with more than one product on a page.
Code:
<b>NB: Currency conversion is based on EX VAT price.</b><br />
<span
id="viewiframe<actinic:variable name="ProductID" />"
onclick="DoViewIFRAME<actinic:variable name="ProductID" />('viewiframe<actinic:variable name="ProductID" />','hideiframe<actinic:variable name="ProductID" />','aniframeupstart<actinic:variable name="ProductID" />');"
style="line-height: 16px;
font-size: 14px;
font-weight: bold;
font-family: sans-serif;
color: brown;
background-color: LightBlue;">
<nobr>[View Currency Converter]</nobr>
</span>
<span
id="hideiframe<actinic:variable name="ProductID" />"
onclick="DoHideIFRAME<actinic:variable name="ProductID" />('hideiframe<actinic:variable name="ProductID" />','aniframeupstart<actinic:variable name="ProductID" />','viewiframe<actinic:variable name="ProductID" />');"
style="display: none;
line-height: 16px;
font-size: 14px;
font-weight: bold;
font-family: sans-serif;
background-color: DarkBlue;
color: gold;">
<nobr>[Hide Currency Converter]</nobr>
</span>
<div id="aniframeupstart<actinic:variable name="ProductID" />" align="center" style="display: none;">
<iframe src="http://www.xe.com/pca/input.php?Amount=<actinic:variable name="ProductPriceRaw" />&From=GBP&ToSelect=USD" width="620" height="200" name="Currency" frameborder="0" scrolling="no"></iframe>
</div>
<script type="text/javascript" language="JavaScript"><!--
function DoViewIFRAME<actinic:variable name="ProductID" />(tid1,tid2,tid3) {
document.getElementById(tid1).style.display = "none";
document.getElementById(tid2).style.display = "";
document.getElementById(tid3).style.display = "";
}
function DoHideIFRAME<actinic:variable name="ProductID" />(tid1,tid2,tid3) {
document.getElementById(tid1).style.display = "none";
document.getElementById(tid2).style.display = "none";
document.getElementById(tid3).style.display = "";
}
//--></script>
Posted without any warranty or assurance just in case anyone else finds it useful.
Comment