magento的默认情况,价格后面是有小数点的,我们来看下如何正确的来去掉小数点。

1.复制如下路径的文件 app/code/core/Mage/Directory/Model/Currency.php 到 app\code\local\Mage\Directory\Model\ 文件夹下面,这个文件夹没有自己手动创建下。

2.打开新复制的这个文件 Currency.php

public function format($price, $options=array(), $includeContainer = true, $addBrackets = false)
    {
        return $this->formatPrecision($price, 2, $options, $includeContainer, $addBrackets);
    }
修改为:
public function format($price, $options=array(), $includeContainer = true, $addBrackets = false)
    {
        return $this->formatPrecision($price, 0, $options, $includeContainer, $addBrackets);
    }
其实就是将2改成了0。
3.刷新magento缓存,去前台页面看下,小数点应该去掉了。转载表明出处:www.hellokeykey.com

Magento去掉价格的小数点的更多相关文章

  1. Magento的价格去掉小数点

    Magento的默认情况,价格后面是有小数点的,我们来看下如何正确的来去掉小数点. 1.复制如下路径的文件 app/code/core/Mage/Directory/Model/Currency.ph ...

  2. magento 去掉index.php .html

    首先应该确保你的服务器环境,达到了magento的运行需求,若你是使用的是magento专用空间就不必担心了,若不是请查看我以前的文章,检测你的运行环境(http://www.hellokeykey. ...

  3. magento去掉小数点后面的0

     <?php echo $_product->getPrice()?> PHP number_format() 函数  <?php echo number_format($_p ...

  4. magento去掉add to cmpre和email to friend

    修改:\app\design\frontend\default\blanco\template\catalog\product下list.phtml 和app\design\frontend\defa ...

  5. magento 常用的函数

    1.Magento eav_attribute表中source如何指定自定义数据来源  如果你引用的类名为yebihai_usermanage_model_entity_school你必须完整的给出地 ...

  6. Magento笔记/记录(1)

    1.Magento eav_attribute表中source如何指定自定义数据来源  如果你引用的类名为yebihai_usermanage_model_entity_school你必须完整的给出地 ...

  7. MySQL学习笔记(1/2)

    数据库的学习要求:1.为项目设计表:2.使用SQL(Structure Query Language)语句(SQL编程).其他的都可以使用工具完成. SQL: DDL:创建库.创建表 DML:对数据的 ...

  8. 【转】关于Oracle将小于1的数字to_char后丢掉0的解决办法

    SQL代码如下: select rtrim(to_char(0.11, 'fm9990.99'), '.') from dual; 其中0.11为需要to_char的数字fm去掉字符串前面的空格999 ...

  9. Android WebView 向上向下滑动监听

    在手势的 public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,   float velocityY) {}代码 ...

随机推荐

  1. BZOJ1807 : [Ioi2007]Pairs 彼此能听得见的动物对数

    一维的情况: 排序后维护一个单调指针即可,时间复杂度$O(n\log n)$. 二维的情况: 旋转坐标系后转化为二维数点问题,扫描线+树状数组维护即可,时间复杂度$O(n\log n)$. 三维的情况 ...

  2. BZOJ3498 : PA2009 Cakes

    令三元环(i,j,k)中i>j>k,则每条边只需要从大点连向小点 设d[x]表示从x连出的边的条数 从1到n枚举点i,然后枚举所有与i相连的边(i,x)(x<i) 如果$d[x]\l ...

  3. Treap和名次树

    Treap名字的来源:Tree+Heap,正如名字一样,就是一颗简单的BST,一坨堆的合体.BST的不平衡的根本原因在于基于左<=根<=右的模式吃单调序列时候会无脑成长链,而Treap则添 ...

  4. 像jQuery那样,采用链式方法,封装一个方法:CSS()

    主要思路就是:返回this对象,将所获取的操作元素放入一个数组中.在原型中添加拓展方法 <html> <head> <title></title> &l ...

  5. jQuery加载外部文件的方式get、post、ajax、load的区别及异步加载的实现

    一.$.post(url, [data], [callback], [type])  url (String) : 发送请求的URL地址. data (Map) : (可选) 要发送给服务器的数据,以 ...

  6. Reprojection Matrix Q

    Given the disparity d and 2D point (x, y) , we can derive the 3D depth using the 4-by-4 reprojection ...

  7. [转]Web Service Authentication

    本文转自:http://www.codeproject.com/Articles/9348/Web-Service-Authentication Download source files - 45. ...

  8. 对于flat_interface与public_interface的理解

    对于这两个interface含义的理解一波三折,下面我把各种理解都记录下来.   2014-9-23   #可以把flat_interface理解为Openstack整套生态系统内部的网络接口,内部各 ...

  9. 数据库存储txt文本和jpg图片

    环境:MySql+SQLyog+j2se+jdbc 存储文本用longtext类型 存储图片用blob类型 1.首先建表 create table t_t (id int(16) NOT NULL A ...

  10. 【转】Html页面结构范例

    原文地址:http://www.51testing.com/html/38/225738-220986.html · HTML · HEAD · LINK ... CSS files required ...