You are here:  » currencies


currencies

Submitted by gahanpip on Mon, 2016-04-04 14:34 in

Could you tell me if it is possible to use dual/mixed currencies? say £ and $ to reflect the database prices.

Thanks Philip

Submitted by support on Mon, 2016-04-04 14:56

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>
&pound;<?php print tapestry_price($price_gbp); ?>
|
&dollar;<?php print tapestry_price($price_usd); ?>
</p>

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by gahanpip on Tue, 2016-04-05 15:16

Thank you again

Philip