magento currency magento头部增加币种切换选择
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 ¤) 即可
¤为货币符号位置
以上来源点这里
相同介绍还有
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头部增加币种切换选择的更多相关文章
- 为JQuery EasyUI 表单组件增加“焦点切换”功能
1.背景说明 在使用 JQuery EasyUI 各表单组件时,实际客户端页面元素是由 JQuery EasyUI 生成的,元素的焦点切换,虽然 Tab 键可以正常用,但顺序控制属性 tabinde ...
- magento -- 解决magento错误:ERROR: Base table or view already exists: 1050 Table ... already exists
相信有更新magento或者,备份转移magento站点的时候可能会碰到类似这样的错误提示: Base table or view already exists: 1050 Table ... alr ...
- magento cache,magento index
"Magento后台作修改,Magento前台没变化""Magento属性更新了,Magento前台没反应"如果你碰到了以上两种情况,或者看到截图中的提示: 您 ...
- magento -- 给Magento提速之缓存上的探索
依然在为Magento提速做努力,除了自带的缓存和编译,之前的所作的很多努力都是从减少JS,Css,图片等载入时间入手,而对页面载入耗时最早有时也是最大的一部分--获取页面数据没有做太多处理,以gap ...
- 图文形式分享网页到facebook (要求:可以多个图片切换选择)
分享网页到facebook的功能很常见,之前都是简单的网页分享,没遇到什么砍儿.这次的需求相比之前有一丁点特殊,就是图片得是用户指定选择的. fb文档地址:https://developers.fac ...
- 移动端 vue + mintUI 实现头部页签切换,按需加载~
记录~记录~~有时候,我们会遇到一个页面有两个页签切换需求,但是为了避免同时加载两个页面,我们要做到的就是当前进入的是那个页面,就先加载哪一个页面,并且也不会造成浏览器地址的变化.一开始我使用的方法是 ...
- MVC之三个单选按钮的切换选择
实现需求: 1.三个多选按钮中:只能同时选择限时抢购和分享金或者拼团特惠和分享金,其中限时抢购和拼团特惠不能同时选择.并且点击后显示,再次点击赢隐藏. 1 @*活动信息*@ 2 <div> ...
- DropDownList切换选择,服务器控件Repeater未更新
将EnableViewState属性设置为false,这样禁止服务器控件使用视图状态,也就是禁止发送给浏览器HEML中的缓存副本, 每次都会使用新数据. 一旦页面的控件很多,频繁的传递控件状态值对网络 ...
- js左右切换 选择年龄
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
随机推荐
- HTTP脚本化——XMLHttpRequest对象的学习笔记
一. HTTP 请求和响应 一个HTTP请求由4部分组成 HTTP请求方法(也叫动作Verb) 正在请求的URL 一个可选的请求头集合(可能包含身份验证信息等) 一个可选的请求主体 服务器返回的HTT ...
- PHP——字符串统一转码为GBK,自动判断是否UTF8并转码
public static function strToGBK($strText) { $encode = mb_detect_encoding($strText, array('UTF-8','GB ...
- ThinkPHP中数据库操作返回值总结
转自:http://www.baiwar.com/post/thinkphp-database-operations-in-the-return-value.html Thinkphp中的Think\ ...
- sql server还原数据库文件(.bak)常见问题解决办法笔记
还原的时候出现错误:备份集中的数据库备份与现有的数据库不同 SQL Server 2005数据库还原出错错误具体信息为:备份集中的数据库备份与现有的A数据库不同 具体操作如下:第一次:新建了数据库A, ...
- linux :TOP命令及参数解析
第二行 分别显示:total进程总数. running正在运行的进程数. sleeping睡眠的进程数.stopped停止的进程数. zombie僵尸进程数. 第三行 分别显示: %us 用户空间占用 ...
- bzoj 1877: [SDOI2009]晨跑
#include<cstdio> #include<iostream> #include<cstring> #define M 6009 #define inf 2 ...
- 利用smarty call函数实现无限极分类
定义一个function {function name=menu level=0} <ul class="level{$level}"> {foreach $data ...
- validator
http://rickharrison.github.io/validate.js/validate.js rules: 'required|callback_check_password' vali ...
- 怎么用navicat自动备份mysql数据库
打开navicat客户端,连上mysql后,双击左边你想要备份的数据库.点击“计划”,再点击“新建批处理作业”. 双击上面的可用任务,它就会到下面的列表里去,代表你选择了这个任务. 点击保存, ...
- Hibernate对象映射类型
Hibernate understands both the Java and JDBC representations of application data. The ability to rea ...