levelfivehub/simplecart

A Cart handling module for adding/updating/removing items. This module is for Zend Framework 2 only.

Installs: 16

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

pkg:composer/levelfivehub/simplecart

v1.2.3 2015-09-29 14:14 UTC

This package is auto-updated.

Last update: 2025-10-06 06:32:26 UTC


README

Build Status Coverage Status

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');