mkakpabla / session-shoppingcart
此包最新版本(1.0.1)没有提供许可信息。
1.0.1
2019-10-20 20:21 UTC
Requires
- symfony/var-dumper: ^4.3
Requires (Dev)
- phpunit/phpunit: ^8.4
- squizlabs/php_codesniffer: ^3.5
This package is auto-updated.
Last update: 2024-09-21 20:43:47 UTC
README
购物车
要求
- PHP 7.2 或更高版本
- 使用Composer进行安装
快速开始
安装
composer require "mkakpabla/shoppingcart"
用法
<?php require 'vendor/autoload.php'; $cart = new Cart(); $cart->addItem(1, [ 'name' => 'item1', 'price' => 'item2' ], 2); // Return the list of the CartItems $items = $cart->getItems(); // Return the price of the cart $cartPrice = $items->totalPrice()