Magento 1.8 – Multicurrency Converter

currencycurrency-ratesmagento-1.8multicurrency

How can I do a currency converter in Magento Community edition 1.8? Does Magento has this functionality by default or do I have to developed it?

I need to show a second currency in on each of my product page (in parentheses) when you select a currency option from the converter's dropdown.

it is like this store in Euro currency and I can get it converted to Pound,

enter image description here

Is it possible?

Best Answer

You might have noticed the “Currency Setup” tab in Magento’s Administration under “System->Configuration” menu. There you should select default site currency, and besides that, all currencies you want to support.
Screenshot:
scshot

After doing that, go to “System->Manage Currency Rates” and set rates for currencies you’ve chosen before. You can use Webservicex to import currency rates from Webservicex service.
After this, create a custom file, save it in “YOUR_PACKAGE/YOUR_THEME/template/currency/" as currency.phtml and put this code.

<?php if($this->getCurrencyCount() > 1): ?>
<div class="form-language">
    <label for="custom-currency-selector"><?php echo $this->__('Your Currency:') ?></label>
    <select onchange="window.location.href=this.value" name="custom-currency-selector" id="custom-currency-selector">
        <?php foreach ($this->getCurrencies() as $_code => $_name): ?>
        <option value="<?php echo $this->getSwitchCurrencyUrl($_code)?>"
            <?php if($_code == $this->getCurrentCurrencyCode()): ?>
                selected="SELECTED"
            <?php endif; ?>>
            <?php echo $_code ?>
        </option>
        <?php endforeach; ?>
    </select>
</div>
<?php endif; ?>  

Reflect these chances in magento, create a local.xml file, use this code:

    <?xml version="1.0"?>
    <layout version="0.1.0">
        <default>
            <reference name="header">
                <block type="directory/currency" name="custom_currency_selector" template="currency/currency.phtml"/>
            </reference>
        </default>  
</layout>  

Clear cache and you will get the selected currencies in dropdown box of magento header. When you select any other currency, then current value of currency will be converted into selected currency. There is no need to implement currency conversion. Magento comes with built-in currency converter. To display multiple currencies in product page, you may try this link, I had tried this earlier and it worked for me. Link: Adding new currencies in product lists page

Related Topic