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. BZOJ3746 : [POI2015]Czarnoksiężnicy okrągłego stołu

    NOIP前做了几道POI,现在终于能在BZOJ上提交了… 交上去最后几个点WA,看了数据发现p=0的特判错了… p=0,1时特判 p=2时构造两种情况判断 p=3时不考虑1的座位进行DP 可以发现对于 ...

  2. CentOS6.4 利用sendEmail发邮件

    1.下载安装sendEmail wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz tar z ...

  3. TYVJ P1094 矩形分割 标签:DP

    做题记录:2016-08-12 21:42:21 背景 YHOI Train#4 Problem 1 描述 出于某些方面的需求,我们要把一块N×M的木板切成一个个1×1的小方块.对于一块木板,我们只能 ...

  4. 【BZOJ】1103: [POI2007]大都市meg

    http://www.lydsy.com/JudgeOnline/problem.php?id=1103 题意:一棵n节点的树(1<=n<=250000),m条边(1<=m<= ...

  5. c# 使用GetOleDbSchemaTable获取access数据库结构

    c# 使用GetOleDbSchemaTable获取access数据库结构 ado.net可以使用GetOleDbSchemaTable方法来获取access数据库的结构,但得到的datatable的 ...

  6. Android Studio 想说爱你不容易

    开始使用Android Studio 真是非常痛苦的一段经历,而这一切的根源就在于GFW,俗称“墙” 如果避过墙来安装 AS,其实我已经在另外一篇文章中说明:http://www.cnblogs.co ...

  7. 如何使用 Migration创建一个迁移

    切换到YII所在的目录 yii migrate/create test

  8. HTML5:离线存储(缓存机制)-IndexDB

    https://www.w3.org/TR/IndexedDB/ .. <!DOCTYPE html> <html> <head> <meta charset ...

  9. Tesla-> Fermi (550Ti) -> Kepler(680) -> Maxwell (750Ti) -> Volta(was Pascal)

    Pascal GPU Pascal (from French mathematician Blaise Pascal) is Maxwell successor. In this news, we l ...

  10. service mongod start start: Unknown job: mongod问题

    终于解决了这个异常蛋疼的问题,当安装完毕mongodb的时候,执行: root@ubuntu:/usr/local# service mongod start 出现: start: Unknown j ...