Magento display multi-currency, Magento multi-currency settings

Source: Internet
Author: User
Tags php foreach

System-configuration-currency Setup on the right Currency options allowed currencies tick,

Then system-manage Currency Rates Click Import to automatically set the exchange rate or manually enter it yourself, and then save it.

(like Magento install IPS payment channel you need to set the exchange rate of RMB CNY first)

So Magento background settings multi-currency processing is OK.

<?php if ($this->getcurrencycount () >1):?>
<div id= "currency_html" style= "Display:none" >
<?php foreach ($this->getcurrencies () as $_code = $_name):?>
<input type= "Radio" name= "Currency_radio" id= "Currency_radio" onclick= "changecurrency (' <?php echo $_code?> ') ) "Value=" <?php echo $_code?> "<?php if ($_code== $this->getcurrentcurrencycode ()):?> checked <?php endif;?>>
<?php Echo $_code?>
<?php Endforeach;?>
</div>
<script type= "Text/javascript" >
<! [cdata[
function Changecurrency (sObject) {
if (sObject) {
setlocation (' <?php echo $this->helper (' Directory/url ')->getswitchcurrencyurl ()? >currency/' +sObject);
}
}
]]>
document.getElementById (' Currency_display '). Innerhtml=document.getelementbyid (' currency_html '). InnerHTML;
</script>
<?php endif;?>

Magento Foreground custom display multi-currency options :

The subject of the assumption is: app/design/frontend/base/default/this,

Modify the template file template/directory/currency.phtml This changes to the above content:

Then in the head position: template/page/html/header.phtml Pick a location to add the following:

<div id= "Currency_display" ></div>

Then modify the layout file, the content to add (code a) are:

<block type= "directory/currency" name= "right_currency" before= "-" template= "directory/currency.phtml"/>

Home Display multi-currency option change default/layout/cms.xml, <cms_page translate= "label" > This position <reference name= "content" > Add a code name.

The Contents page and the Product detail page show the Multicurrency option , default/layout/catalog.xml the <default><reference name= "left" in this file to add code a.

Background empty cache.

Re-refresh the access, Magento displays the multi-currency option as expected.

Magento display multi-currency, Magento multi-currency settings

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.