|
CI框架,全名CodeIgniter,相信大家都不陌生,她是一个小巧的php框架,CI中国官方网站文档也很全面,现在ci4.0也出来了,加入了命名空间。 不过我个人还是比较喜欢它的2.0版本。 后期版本已经废弃了购物车功能,但对于正在使用ci2.0同学们来说,我总结出购物车类的几个bug, 代码如下:
1.对产品名称的判断规则对中文不友好。经常导致添加失败。
//log_message('error', 'An invalid name was submitted as the product name: '.$items['name'].' The name can only contain alpha-numeric characters, dashes, underscores, colons, and spaces');
//return FALSE;
2.数量不变时,无法修改购物车信息
if ($this->_cart_contents[$items['rowid']]['qty'] == $items['qty'])
{
//return FALSE;
}
3.只能修改数量,无法修改附加选项options 修改options附加选项
$this->_cart_contents[$items['rowid']]['qty'] = $items['qty'];
$this->_cart_contents[$items['rowid']]['options'] = $items['options'];//here new? 本文由php中文网提供, 原文地址: 请勿转载~~~~ |