mkakpabla / session-shoppingcart
There is no license information available for the latest version (1.0.1) of this package.
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-06-21 20:07:09 UTC
README
Shopping Cart
Requirements
- PHP 7.2 or higher
- Composer for installation
Quick Start
Installation
composer require "mkakpabla/shoppingcart"
Usage
<?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()