ecshop商城number_format错误的解决办法

更新时间:2016-09-26 点击量:1363


number_format错误不是所有人的ecshop网站都会出现这个错误,只有符合一定环境和条件的网站才有可能出现这类错误提示,如下:
Warning: number_format() expects parameter 1 to be double, string given in \includes\lib_common.php on line 945
只有满足下述这两个条件时,个别页面才会出现number_format()错误提示。
PHP版本为5.3.0及以上版本
配送方式免费额度为0
那么要如何来解决呢,下面就说一下解决办法,在includes/lib_common.php中找到:

else
{
 $price = number_format($price, 2, '.', '');
}

修改为

else 
{
 if(!$price){
 $price = 0;
 }
 $price = number_format($price, 2, '.', '');
}



更多ecshop二次开发ecshop模板以及相关的可直接联系客服。

支付宝扫码打赏 微信打赏

如果文章对您有帮助,就打赏一个吧

在线客服

客户服务

热线电话:

13128985956 服务时间:

周一到周六:9:00-18:00

在线QQ客服

在线微信客服

关于我们 常见问题

支付方式 加盟合作

提交需求
优惠红包 购物车0 反馈留言 返回顶部