ecshop 后台订单出现number_format() expects parameter 1 to be double
2014-10-28 16:38
351 查看
1. ecshop 后台订单管理出现
number_format() expects parameter 1 to be double, string given in E:\wamp\www\ecshopVjia\includes\lib_common.php on
line 963
2,解决方法 :
(1)
function price_format($price, $change_price = true)
{
$price = 0 + $price; //添加这一行,转换成数值
(2)在lib_common.php on line 963
修改
将includes\lib_common.php 的963行:
else
{
$price = number_format($price, 2, '.', '');
}
修改为
else
{
if(!$price){
$price = 0;
}
$price = number_format($price, 2, '.', '');
}
即可。原因是配送插件里面的免费额度为0,ec本身的bug导致了$price的值为空值,直接调用number_format出现了错误。
number_format() expects parameter 1 to be double, string given in E:\wamp\www\ecshopVjia\includes\lib_common.php on
line 963
2,解决方法 :
(1)
function price_format($price, $change_price = true)
{
$price = 0 + $price; //添加这一行,转换成数值
(2)在lib_common.php on line 963
修改
将includes\lib_common.php 的963行:
else
{
$price = number_format($price, 2, '.', '');
}
修改为
else
{
if(!$price){
$price = 0;
}
$price = number_format($price, 2, '.', '');
}
即可。原因是配送插件里面的免费额度为0,ec本身的bug导致了$price的值为空值,直接调用number_format出现了错误。
相关文章推荐
- Warning: number_format() expects parameter 1 to be double, string given in
- ecshop出现 readdir() expects parameter 1 to be resource, boolean given 错误
- [置顶] Genymotion 出现the number of cpus of the virtual device has been forced to be 1的解决方法
- 解决ECSHOP后台订单里面点击编辑配送方式时出现的警告问题
- PHP ECSHOP中 诡异的问题:expects parameter 1 to be double
- 在android中使用proguard混淆代码出现“Conversion to Dalvik format failed with error 1”错误的解决方法
- cocos2d 安装出现Error: This script must be run as root in order to copy templates to /Library/Applicatio
- 今天写HQL出现了一个低级错误,将from 写错成form了 出现java.lang.IllegalArgumentException: node to traverse cannot be null!
- android 莫名出现Conversion to Dalvik format failed: Unable to execute dex: null 解决方法
- 修改ListItem时出现Error: Invalid data has been used to update the list item. The field you are trying to update may be read only.
- android中使用代码混淆出现Conversion to Dalvik format failed with error 1错误的解决办法
- 安装过程freetype字体时出现make: Nothing to be done for `unix'.
- 使用asp.net urlrewrite 出现 Session state can only be used when enableSessionState is set to true 错误
- 在android中使用proguard混淆代码出现“Conversion to Dalvik format failed with error 1”错误的解决方法
- 更新android sdk出现 A folder failed to be renamed or moved
- android中使用代码混淆出现Conversion to Dalvik format failed with error 1错误的解决办法
- 断电或强制退出后VMware虚拟机出现The virtual machine appears to be in use无法启动问题解决
- [PHP] Which function can be used to format a local timestamp according to a specific locale?
- Convert char to numbers, the number must be declare as P
- jsp页面出现“String cannot be resolved to a type”错误解决办法