Using Yahoo! Finance for Currency Exchange Rate Retrieval

Last modified by tisha09 on Wed, September 19, 2012 06:54
Show Page|Old Revisions  

This shows you the differences between the selected revision and the current version of the page.

5_-_modules_and_development:using_yahoo_finance_for_currency_exchange_rate_retrieval 2012/09/19 06:54 5_-_modules_and_development:using_yahoo_finance_for_currency_exchange_rate_retrieval 2014/01/27 07:33 current
Line 13: Line 13:
I have mimicked the Webservicex currency retrieval code. That one resides in /app/code/core/Mage/Directory/Model/Currency/Import/Webservicex.php so you can have a look yourself. In line with that code and structure, first create the following folder structure and file: I have mimicked the Webservicex currency retrieval code. That one resides in /app/code/core/Mage/Directory/Model/Currency/Import/Webservicex.php so you can have a look yourself. In line with that code and structure, first create the following folder structure and file:
-[[http://www.paydayin1hour.co.uk|Payday UK]]+
/app/code/local/JT/Directory/Model/Currency/Import/Yahoofinance.php /app/code/local/JT/Directory/Model/Currency/Import/Yahoofinance.php
-[[http://www.cash-in-1-hour.com.au|cash loans]] 
===== Step 2 - Paste Code into Yahoofinance.php ===== ===== Step 2 - Paste Code into Yahoofinance.php =====
Line 116: Line 115:
In the drop-down, Webservicex is still the top one so simply select Yahoo Finance from there and click the Import button. In the drop-down, Webservicex is still the top one so simply select Yahoo Finance from there and click the Import button.
-http://www.mypayday.co.uk 
===== Step 5 - Optional - Cron Setup ===== ===== Step 5 - Optional - Cron Setup =====
Line 122: Line 120:
In Admin under System > Configuration go to Currency Setup under the Default Configuration scope. Enable the cron for Yahoo Finance here under Scheduled Import Settings (I've not yet tested this). In Admin under System > Configuration go to Currency Setup under the Default Configuration scope. Enable the cron for Yahoo Finance here under Scheduled Import Settings (I've not yet tested this).
-[[http://www.kwikcash.co.uk|quick cash]] 
===== Important Notes ===== ===== Important Notes =====
Line 130: Line 127:
Yahoo! supplies these rates in csv files to the public. It's up to you whether you ass-u-me that you can now use them in an automated fashion for commercial benefit or kindly request permission, or at least read the small print. Yahoo! supplies these rates in csv files to the public. It's up to you whether you ass-u-me that you can now use them in an automated fashion for commercial benefit or kindly request permission, or at least read the small print.
-http://www.kwikpayday.co.uk 
===== Advanced Usage ===== ===== Advanced Usage =====
Line 136: Line 132:
Note line 55 where the exchange rate is being returned. By default it's returned as is, but some may want to influence this. For example, right now Yahoo! reckons one GBP is worth 1.1157 EUR. A 100 Pound item will be displayed as 115.70 Euro. When paying by bank transfer or credit card, they will be surprised when they read their bank statements as the bank's rate will be more like 1.19 so they get deducted the grand sum of 119 Euro for that product. They may think you are falsely advertising the rates and pocketing the difference, even though your T's & C's will mention this possible discrepancy. So with this rate influencer ratio, you can dampen the fun a bit by using for example 1.049 instead of 1.0 (that allows for 4.9% mark-up by the banks). Now the products will look more expensive but there won't be any surprises on their bank statements. Note line 55 where the exchange rate is being returned. By default it's returned as is, but some may want to influence this. For example, right now Yahoo! reckons one GBP is worth 1.1157 EUR. A 100 Pound item will be displayed as 115.70 Euro. When paying by bank transfer or credit card, they will be surprised when they read their bank statements as the bank's rate will be more like 1.19 so they get deducted the grand sum of 119 Euro for that product. They may think you are falsely advertising the rates and pocketing the difference, even though your T's & C's will mention this possible discrepancy. So with this rate influencer ratio, you can dampen the fun a bit by using for example 1.049 instead of 1.0 (that allows for 4.9% mark-up by the banks). Now the products will look more expensive but there won't be any surprises on their bank statements.
-http://www.paydaybank.co.uk 
===== Discussion ===== ===== Discussion =====
If you think the implementation lacks or it can be better in a certain way, feel free to discuss here (click edit and amend this "discussion" part) and PM me to discuss. Or post in the "official" thread here: [[http://www.magentocommerce.com/boards/viewthread/32253/]]. If you think the implementation lacks or it can be better in a certain way, feel free to discuss here (click edit and amend this "discussion" part) and PM me to discuss. Or post in the "official" thread here: [[http://www.magentocommerce.com/boards/viewthread/32253/]].



 

Magento 2 GitHub Repository

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs