\Cart

购物车基本功能 1) 将物品加入购物车 2) 从购物车中删除物品 3) 更新购物车物品信息 【+1/-1】 4) 对购物车物品进行统计 1. 总项目 2. 总数量 3. 总金额 5) 对购物单项物品的数量及金额进行统计 6) 清空购物车

Summary

Methods
Properties
Constants
__construct()
insert()
update()
total()
total_items()
contents()
options()
destroy()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
has_options()
_insert()
_update()
_save_cart()
cartDB()
comCartDB()
clearCartDB()
getCartID()
_log()
$product_id_rule
$product_name_rule
$debug
$_cart
$db
N/A

Properties

$product_id_rule

$product_id_rule

$product_name_rule

$product_name_rule

$debug

$debug

$_cart

$_cart

$db

$db

Methods

__construct()

__construct() : mixed

构造函数

Returns

mixed —

insert()

insert(mixed  $items = array()) : bool

将物品加入购物车

Parameters

mixed $items

Returns

bool —

update()

update(mixed  $items = array()) : bool

更新购物车物品信息

Parameters

mixed $items

Returns

bool —

total()

total() : int

获取购物车物品总金额

Returns

int —

total_items()

total_items() : int

获取购物车物品种类

Returns

int —

contents()

contents() : array

获取购物车

Returns

array —

options()

options(mixed  $rowid = '') : array

获取购物车物品options

Parameters

mixed $rowid

Returns

array —

destroy()

destroy() : mixed

清空购物车

Returns

mixed —

has_options()

has_options(mixed  $rowid = '') : bool

判断购物车物品是否有options选项

Parameters

mixed $rowid

Returns

bool —

_insert()

_insert(mixed  $items = array()) : bool

插入数据

Parameters

mixed $items

Returns

bool —

_update()

_update(mixed  $items = array()) : bool

更新购物车物品信息(私有)

Parameters

mixed $items

Returns

bool —

_save_cart()

_save_cart() : bool

保存购物车数据到session

Returns

bool —

cartDB()

cartDB(mixed  $arr) : mixed

Parameters

mixed $arr

Returns

mixed —

comCartDB()

comCartDB() : mixed

Returns

mixed —

clearCartDB()

clearCartDB() : mixed

Returns

mixed —

getCartID()

getCartID() : mixed

Returns

mixed —

_log()

_log(mixed  $msg) : bool

日志记录

Parameters

mixed $msg

Returns

bool —