PHPackages                             indigophp/simple-cart - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. indigophp/simple-cart

AbandonedArchivedLibrary

indigophp/simple-cart
=====================

Simple implementation of Indigo Cart

04[3 issues](https://github.com/indigophp/simple-cart/issues)PHP

Since Jan 26Pushed 11y ago2 watchersCompare

[ Source](https://github.com/indigophp/simple-cart)[ Packagist](https://packagist.org/packages/indigophp/simple-cart)[ RSS](/packages/indigophp-simple-cart/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Indigo Simple Cart
==================

[](#indigo-simple-cart)

[![Latest Version](https://camo.githubusercontent.com/7018eb8c1682e81f39d6aa4988e839534c5ceda5417545e9151ccf83f262d0c5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f696e6469676f7068702f73696d706c652d636172742e7376673f7374796c653d666c61742d737175617265)](https://github.com/indigophp/simple-cart/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://camo.githubusercontent.com/84a10ac6ff2985f91132ec06cff284b35ca5fd9b7417ee55146ebe524c95a713/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f696e6469676f7068702f73696d706c652d636172742e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/indigophp/simple-cart)[![Code Coverage](https://camo.githubusercontent.com/cb73dec9a90382c4fd4246159676296fe0734062024eb69ff94dba33a4ea6c24/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f696e6469676f7068702f73696d706c652d636172742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/indigophp/simple-cart)[![Quality Score](https://camo.githubusercontent.com/654f1ba92b43d17c8aea34e22a7c8420a9781968ab78c0d92af7ba296d1262f5/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f696e6469676f7068702f73696d706c652d636172742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/indigophp/simple-cart)[![HHVM Status](https://camo.githubusercontent.com/cfa63ac611a8c753b375077cff28f8c07b38bd796a9754fd6d538c8c3d24ab4b/68747470733a2f2f696d672e736869656c64732e696f2f6868766d2f696e6469676f7068702f73696d706c652d636172742e7376673f7374796c653d666c61742d737175617265)](http://hhvm.h4cc.de/package/indigophp/simple-cart)[![Total Downloads](https://camo.githubusercontent.com/8c1bcea85dbcba6178038244f1f28a5a9af99680687ef77203b11cca70235e26/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696e6469676f7068702f73696d706c652d636172742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/indigophp/simple-cart)[![Dependency Status](https://camo.githubusercontent.com/7215d199630e5012eac33f4e04450d47a8299155cd4852f0ba96a18d8437e08d/68747470733a2f2f696d672e736869656c64732e696f2f76657273696f6e6579652f642f7068702f696e6469676f7068703a73696d706c652d636172742e7376673f7374796c653d666c61742d737175617265)](https://www.versioneye.com/php/indigophp:simple-cart)

**Simple implementation of [Indigo Cart](https://github.com/indigophp/cart).**

Install
-------

[](#install)

Via Composer

```
$ composer require indigophp/simple-cart
```

Usage
-----

[](#usage)

```
use Indigo\Cart\Cart;
use Indigo\Cart\Item;
use Indigo\Cart\Store;

/* Note: these are interfaces, you cannot instantiate them */

$cart = new Cart\Simple;

// Throws an exception if any of these are invalid
// name, price, quantity [, id]
$cart->addItem(new Item\Simple('Item', 1, 1, '_ITEM_'));

// Get total price
$cart->getTotal();

// Get item count (item * quantity)
$cart->getQuantity();

foreach($cart->getItems() as $id => $item) {
    // Get subtotal
    $item->getSubtotal();

    // Get price
    $item->getPrice();

    // Get name
    $item->getName();
}

// Throws an Indigo\Cart\Exception\ItemNotFound
$cart->getItem('non_existent');

// Accepts a session key
$store = new Store\Session('cart');
$store->save($cart);
```

Get existing cart:

```
use Indigo\Cart\Store;

$store = new Store\Session('cart');
$cart = $store->find('cart_id');

// Throws an Indigo\Cart\Exception\CartNotFound
$store->find('non_existent');
```

Testing
-------

[](#testing)

```
$ phpspec run
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Márk Sági-Kazár](https://github.com/sagikazarmark)
- [All Contributors](https://github.com/indigophp/simple-cart/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0e4e105cea62b616d4cb376b08a849b6a428f646998537de150d16a8eb537b90?d=identicon)[mark.sagikazar](/maintainers/mark.sagikazar)

![](https://www.gravatar.com/avatar/1585b5a08e138e348f5b646231d0f16cb2eae06501fb9462bbc97a794d4de84a?d=identicon)[TamasBarta](/maintainers/TamasBarta)

---

Top Contributors

[![sagikazarmark](https://avatars.githubusercontent.com/u/1226384?v=4)](https://github.com/sagikazarmark "sagikazarmark (2 commits)")

### Embed Badge

![Health badge](/badges/indigophp-simple-cart/health.svg)

```
[![Health](https://phpackages.com/badges/indigophp-simple-cart/health.svg)](https://phpackages.com/packages/indigophp-simple-cart)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
