ecshop配送方式出错lib_common.php on line 959

2016-09-07 22:03 来源:www.chinab4c.com 作者:ecshop专家

 ecshop只带的配送方式BUG

只要不是正式商业版的ECSHOP都会出现 配送方式配置出错。提示

Warning: number_format() expects parameter 1 to be double, string given in D:\\**\\lib_common.php on line 959

Warning: number_format() expects parameter 1 to be double, string given in D:\\**\\lib_common.php on line 959

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

修改:

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

修改为

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

即可。

(责任编辑:chinab4c)