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

This package is auto-updated.

Last update: 2024-04-06 03:12:57 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');