Download the PHP package yzh52521/webman-shop-cart without Composer
On this page you can find all versions of the php package yzh52521/webman-shop-cart. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yzh52521/webman-shop-cart
More information about yzh52521/webman-shop-cart
Files in yzh52521/webman-shop-cart
Package webman-shop-cart
Short Description Shopping cart for webman plugin.
License MIT
Informations about the package webman-shop-cart
webman-shop-cart
购物车在电商场景中基本是必须的一个模块
安装
用法
选择 Storage
您可以更改数据存储在 config/plugin/yzh52521/shop-cart/app.php 配置文件.
如果更改数据存储如果使用数据库存储,则需要创建数据表:
添加到购物车
add item
example:
更新购物车
Update the specified item。
example:
获取购物车中所有商品
Get all the items.
example:
获取一个商品
Get the specified item.
example:
删除商品
Remove the specified item by raw ID.
example:
清理购物车
Clean Shopping Cart.
example:
购物车总价格
Returns the total of all items.
example:
购物车商品个数
Return the number of rows.
example:
购物车商品数量
Returns the quantity of all items
$totalItems : When false,will return the number of rows.
example:
搜索商品
Search items by property.
example:
检查购物车是否为空
指定关联的商品模型
Specifies the associated model of item.
example:
session
database
购物车商品
properties of yzh52521\ShopCart\Item:
id- 商品IDname- 商品名称qty- 商品数量price- 商品单价total- 商品总价.__raw_id- 唯一ID.__model- 模型关联的名称.- ...自定义属性.
方法:
rawId()- Return the raw ID of item.
事件
| 事件名 | 参数 |
|---|---|
cart.adding |
($attributes, $cart); |
cart.added |
($attributes, $cart); |
cart.updating |
($row, $cart); |
cart.updated |
($row, $cart); |
cart.removing |
($row, $cart); |
cart.removed |
($row, $cart); |
cart.destroying |
($cart); |
cart.destroyed |
($cart); |
License
MIT
All versions of webman-shop-cart with dependencies
workerman/webman-framework Version ^1.2.1
yzh52521/webman-event Version ^1.0
tightenco/collect Version ^8.78|^9.0