To display approximately equivalent £ and $ prices alongside, for example, a € price, first add the Currency Conversion filter from this thread but remove the following line:
With this in place (and the new job run to fetch the feed for the first time), you can then use the filter in real time on product pages to show converted prices. In html/product.php you could include for example:
Hi Philip,
To display approximately equivalent £ and $ prices alongside, for example, a € price, first add the Currency Conversion filter from this thread but remove the following line:
copy("http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml",$filename);
Instead, set-up an Automation Tool job to fetch the ECB currency feed when your cron job runs, e.g. using a URL of:
http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml
And the filename to Save As... of:
cc_rates.xml
With this in place (and the new job run to fetch the feed for the first time), you can then use the filter in real time on product pages to show converted prices. In html/product.php you could include for example:
<?php
require("includes/filter.php");
$filter_data["cc_from"] = "EUR";
$filter_data["cc_to"] = "GBP";
$price_gbp = filter_ccExec($filter_data,$product_main["price"]);
$filter_data["cc_to"] = "USD";
$price_usd = filter_ccExec($filter_data,$product_main["price"]);
?>
<p>
£<?php print tapestry_price($price_gbp); ?>
|
$<?php print tapestry_price($price_usd); ?>
</p>
Hope this helps!
Cheers,
David.
--
PriceTapestry.com