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显示多货币选项如预期的实现了。

  • 相关阅读:
    egret 里面设置MovieClip的scale缩放值时,没有效果的情况
    游戏中的胜场数,净胜场数的计算
    使用Laya引擎和AS3(非原生AS)开发手游相关 总结常见bug
    javascript 一些注意事项
    JavaScript面向对象学习小结
    编写协议时注意事项
    Jenkins 在windows系统上的安装与使用
    LayaAir2.0 自定义Mesh-画圆环
    LayaAir2.0 自定义Mesh-画扇形
    Cocos Creator 使用 protobuf
  • 原文地址:https://www.cnblogs.com/focai/p/4781950.html
Copyright © 2011-2022 走看看