exdeliver / cart
Laravel应用的购物车系统
dev-master
2021-10-26 08:17 UTC
Requires
- akaunting/money: ^1.0
This package is auto-updated.
Last update: 2024-09-26 14:34:21 UTC
README
适用于按产品系统征收增值税的商店的购物车实现。具有分拆增值税功能。由Jason Hoendervanger - EXdeliver.nl编写
需求
运行此内容管理系统所需的系统要求
PHP 7.1.3 or later
如何安装
composer require exdeliver/cart
添加到app.php提供者 & 别名
\Exdeliver\Cart\ServiceProviders\CartServiceProvider::class,
'Cart' => \Exdeliver\Cart\Facades\CartServiceFacade::class,
命令
添加到购物车
Cart::add([
'product_id' => $product->id,
'name' => $product->name,
'gross_price' => $product->price,
'vat' => $product->vat,
'quantity' => 1,
'type' => 'item', // item, discount, fee, other (item and other are countable items quantity() )
]);
Cart::subtotal()
Cart::vats()
Cart::total()
Cart::vatTotal()
Cart::discounts()
Cart::summary() // Returns all of above in json format.