magento currency

magento头部增加币种切换选择

默认magento 货币选择切换是显示在左边 有时候我们需要让其显示在头部

Step 1. Create a new file app/design/frontend/default/Your_Theme/template/directory/currency-top.phtml

<?php if($this->getCurrencyCount()>1): ?>
<div class="block block-currency-top">
<strong><span><?php echo $this->__('Select Your Currency') ?></span></strong>
<select name="currency" title="<?php echo $this->__('Select Your Currency') ?>" onchange="setLocation(this.value)">
<?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 $_name ?> - <?php echo $_code ?>
</option>
<?php endforeach; ?>
</select>
</div>
<?php endif; ?>

Step 2. Now add the below given line of code inside header block in app/design/frontend/default/Your_Theme/layout/page.xml

<block type="directory/currency" name="currency_top" template="directory/currency-top.phtml"/>

Step 3. Add the below given line in app/design/frontend/default/Your_Theme/template/page/html/header.phtml

<?php echo $this->getChildHtml('currency_top'); ?>

以上来源点这里

修改magento货币符号和货币符号的位置
用magento建多语言店面的时候往往要添加相应的货币,有时候想修改货币符号为自己想要的格式,怎么修改呢?这里提供一个简单方法:
1.首先要在configuration General => Locale options => Locale检查你的语言环境是什么
2.如果你的locale 是默认的选项“English (United States)”,就打开lib/Zend/Locale/Data/目录下的en.xml 编辑
3.例如你要修改日元符号为”円”(默认是显示”¥”),就搜索“JPY”大约3245行找到下面代码,把”¥”修改成”円” 保存

<currency type="JPY">
<displayname>Japanese Yen</displayname>
<displayname count="one">Japanese yen</displayname>
<displayname count="other">Japanese yen</displayname>
<symbol>¥</symbol>
</currency>

4.保存上传后清楚后台缓存System –> Cache Management
5.到这里刷新前台也许还没变,要删掉var下的cache缓存目录 /var/cache
6.刷新前台OK了
还有一个问题,修改后前台显示的是”円25,522.64 ” ,我想把符号放在后面怎么修改呢?方法很简单,还是编辑en.xml ,搜索”” 大约2597行找到下面代码

<currencyformatlength>
<currencyformat>
<pattern>¤#,##0.00;(¤#,##0.00)</pattern>
</currencyformat>
</currencyformatlength>

将¤#,##0.00;(¤#,##0.00)改成#,##0.00 ¤;(#,##0.00 ¤) 即可
¤为货币符号位置
以上来源点这里

相同介绍还有

改变Magento Currency布局

Custom Magento Currency Switcher in Header

How to add Currency selector to Magento’s header

将顶部币种换位图片
则currency.phtml 内容修改为

<?php if($this->getCurrencyCount()>1): ?>
<div class="currency" style="text-align: right; position: relative; top: 26px; right: 18px;">
<?php foreach ($this->getCurrencies() as $_code => $_name): ?> <a href="<?php echo $this->getSwitchCurrencyUrl($_code) ?>" onclick="setLocation(this.value);">
<img src="/images/<?php echo $_code ?>.png" title="<?php echo $_name ?> - <?php echo $_code ?>"/>
</a>
<?php endforeach; ?>
</div>
<?php endif; ?>

来自Add flag icons to your Magento site header to switch currency

magento currency magento头部增加币种切换选择的更多相关文章

  1. 为JQuery EasyUI 表单组件增加“焦点切换”功能

    1.背景说明 在使用 JQuery  EasyUI 各表单组件时,实际客户端页面元素是由 JQuery EasyUI 生成的,元素的焦点切换,虽然 Tab 键可以正常用,但顺序控制属性 tabinde ...

  2. magento -- 解决magento错误:ERROR: Base table or view already exists: 1050 Table ... already exists

    相信有更新magento或者,备份转移magento站点的时候可能会碰到类似这样的错误提示: Base table or view already exists: 1050 Table ... alr ...

  3. magento cache,magento index

    "Magento后台作修改,Magento前台没变化""Magento属性更新了,Magento前台没反应"如果你碰到了以上两种情况,或者看到截图中的提示: 您 ...

  4. magento -- 给Magento提速之缓存上的探索

    依然在为Magento提速做努力,除了自带的缓存和编译,之前的所作的很多努力都是从减少JS,Css,图片等载入时间入手,而对页面载入耗时最早有时也是最大的一部分--获取页面数据没有做太多处理,以gap ...

  5. 图文形式分享网页到facebook (要求:可以多个图片切换选择)

    分享网页到facebook的功能很常见,之前都是简单的网页分享,没遇到什么砍儿.这次的需求相比之前有一丁点特殊,就是图片得是用户指定选择的. fb文档地址:https://developers.fac ...

  6. 移动端 vue + mintUI 实现头部页签切换,按需加载~

    记录~记录~~有时候,我们会遇到一个页面有两个页签切换需求,但是为了避免同时加载两个页面,我们要做到的就是当前进入的是那个页面,就先加载哪一个页面,并且也不会造成浏览器地址的变化.一开始我使用的方法是 ...

  7. MVC之三个单选按钮的切换选择

    实现需求: 1.三个多选按钮中:只能同时选择限时抢购和分享金或者拼团特惠和分享金,其中限时抢购和拼团特惠不能同时选择.并且点击后显示,再次点击赢隐藏. 1 @*活动信息*@ 2 <div> ...

  8. DropDownList切换选择,服务器控件Repeater未更新

    将EnableViewState属性设置为false,这样禁止服务器控件使用视图状态,也就是禁止发送给浏览器HEML中的缓存副本, 每次都会使用新数据. 一旦页面的控件很多,频繁的传递控件状态值对网络 ...

  9. js左右切换 选择年龄

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

随机推荐

  1. linux如何修改主机名

    一:#hostname hn1 二:修改/etc/sysconfig/network中的 HOSTNAME=hn1三:修改/etc/hosts文件  127.0.0.1 hn1

  2. 46. Permutations——本质和树DFS遍历无异 fun: for i in nums fun(i)

    Given a collection of distinct numbers, return all possible permutations. For example, [1,2,3] have ...

  3. 我的R代码备份

    1 #f1=scan(file="f1.txt");  2 #f2=scan(file="f2.txt");  3 f=scan(file="5.2_ ...

  4. netty4 断线重连

    转载:http://www.tuicool.com/articles/B7RzMbY 一 实现心跳检测 原理:当服务端每隔一段时间就会向客户端发送心跳包,客户端收到心跳包后同样也会回一个心跳包给服务端 ...

  5. PHP5生成条形码器

    前阵子在做一个商家优惠券的功能,需要用到条形码,于是将资料重新整理下. 1.什么是条形码? 百度百科定义:条形码(barcode)是将宽度不等的多个黑条和空白,按照一定的编码规则排列,用以表达一组信息 ...

  6. qml json 解析到 ListView

    https://github.com/kromain/qml-utils/tree/master/JSONListModel 非常棒!! 实现的原理如下文: http://goessner.net/a ...

  7. LCD驱动 15-1

    app: read() ---------------------------------------------------------------------------------------- ...

  8. word2vec使用说明

    word2vec是一个将单词转换成向量形式的工具.可以把对文本内容的处理简化为向量空间中的向量运算,计算出向量空间上的相似度,来表示文本语义上的相似度. 一.理论概述 (主要来源于http://lic ...

  9. Easy UI 遮罩(MASK)

    From :http://blog.csdn.net/luminji/article/details/16984839 Easy UI 的各类控件有些带了遮罩功能,如 DataGrid,可以这样使用: ...

  10. [安卓]我的安卓开发FAQ

    1.什么是ADT: android官方解释是:ADT (Android Developer Tools) is a plugin for Eclipse that provides a suite o ...