将includes\lib_common.php 的957~959行:
else
{
$price = number_format($price, 2, ‘.’, ”);
}

修改为

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

即可。原因是配送插件里面的免费额度为0,ec本身的bug导致了$price的值为空值,直接调用number_format出现了错误。

赞成lz分析的原因,确实是因为免费额度获取的问题,在PHP5.3上报错
但获取到的应该是一个字符串,所以出错,应该这样改:
function price_format($price, $change_price = true)
{
$price = 0 + $price;//添加这一行,转换成数值

————————————————————————————————————–
上面为论坛网友分析原因和解决办法。

我直接在 includes\lib_common.php中的 priceformat()【格式化商品价格函数】中
加一句

1 对 “Warning: number_format() expects parameter 1 to be double, string given in /Volumes/Data/xiaoniba/www/shop.xiaoniba.com/includes/lib_common.php on line 965”的想法;

发表回复

您的电子邮箱地址不会被公开。