levelfivehub / simplecart
A Cart handling module for adding/updating/removing items. This module is for Zend Framework 2 only.
v1.2.3
2015-09-29 14:14 UTC
Requires
- php: >=5.5
- phpunit/phpunit: 4.8.*
- squizlabs/php_codesniffer: 1.5.*
- zendframework/zend-filter: dev-master
- zendframework/zend-session: 2.5.2
- zendframework/zend-validator: dev-master
This package is auto-updated.
Last update: 2025-03-06 05:11:31 UTC
README
Please note; this only works with Zend Framework 2 as we use the Zend Validator and Zend Session components
This simple cart cannot get any simpler.
Initialise the cart with a name
$simpleCart = new SimpleCart('test');
To add an item
$item = [ 'name' => 'Red Balloon', 'uniqueId' => 'RED001', 'amount' => 10.99, 'quantity' => '1', 'currency' => 'GBP' // optional ]; $simpleCart->addItem($item);
To update an item
$simpleCart->updateItem('RED001', 3);
To remove an item
$simpleCart->removeItem('RED001');