zoukankan      html  css  js  c++  java
  • Magento显示多货币,Magento 多货币设置

    System - Configuration - Currency Setup 在右边Currency Options里的Allowed currencies勾选,

    然后 System - Manage Currency Rates 点击Import自动设置汇率或者自己手动输入,然后保存。

    (像Magento安装IPS支付通道就需要先设置人民币CNY的汇率)

    如此Magento后台设置多货币的处理就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前台自定义显示多货币选项 :

    假定用的主题是:app/design/frontend/base/default/ 这个,

    修改模板文件template/directory/currency.phtml 这个改为以上内容:

    
    

    然后在头部位置:template/page/html/header.phtml 挑个位置加入以下内容:

    <div id="currency_display" ></div>
    

    接着修改布局文件,要加的内容(代号A)都是:

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

    首页显示多货币选项 更改default/layout/cms.xml ,在<cms_page translate="label">这个位置里的<reference name="content">里面加上代号A。

    目录页和商品详细页面显示多货币选项 ,default/layout/catalog.xml 这个文件里的<default><reference name="left">里加入代号A。

    后台清空Cache。

    重新刷新访问,Magento显示多货币选项如预期的实现了。

  • 相关阅读:
    PlantsVsZombies_v2.0_1
    attackZombie如何实现符合需求的攻击函数_3
    attackZombie如何实现符合需求的攻击函数_2
    list_head.h
    attackZombie如何实现符合需求的攻击函数
    PlantsVsZombies_3
    串口服务器在激光切割机远程监控系统中的使用
    串口转以太网服务器在物联网中的行业应用
    物联网能源系统应用解决方案和作用什么?
    4G工业路由器在智能安防和监控中的应用
  • 原文地址:https://www.cnblogs.com/focai/p/4781950.html
Copyright © 2011-2022 走看看