PHPackages                             indigophp/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. [Framework](/categories/framework)
4. /
5. indigophp/cart

AbandonedArchivedLibrary[Framework](/categories/framework)

indigophp/cart
==============

Cart abstraction layer

v2.0.0(11y ago)2132[1 issues](https://github.com/indigophp/cart/issues)1MITPHPPHP &gt;=5.4.0

Since Jul 18Pushed 11y ago3 watchersCompare

[ Source](https://github.com/indigophp/cart)[ Packagist](https://packagist.org/packages/indigophp/cart)[ Docs](https://indigophp.com)[ RSS](/packages/indigophp-cart/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (3)Used By (1)

Indigo Cart
===========

[](#indigo-cart)

[![Latest Version](https://camo.githubusercontent.com/c974209e4faf5cb4149678b6f95d081f3fe98c988ae20f29998bf3be4082dc8a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f696e6469676f7068702f636172742e7376673f7374796c653d666c61742d737175617265)](https://github.com/indigophp/cart/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build Status](https://camo.githubusercontent.com/efd33e004f8192cae0aeeeae61bbd56009243f03a55edd76dfcc15826190ddfa/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f696e6469676f7068702f636172742e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/indigophp/cart)[![Code Coverage](https://camo.githubusercontent.com/2effdf071c3af7581b9094907f69d57135995837fc01b854b58b432f57afb980/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f696e6469676f7068702f636172742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/indigophp/cart)[![Quality Score](https://camo.githubusercontent.com/e53960e099e26726dd0c28b7be9c96ebeb298bfe516aee7465e51e9cd1430bc9/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f696e6469676f7068702f636172742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/indigophp/cart)[![HHVM Status](https://camo.githubusercontent.com/cfc3eb8d1e1ce2f791f9669c9fdee4071b77a2f0ee0d3f700608eb52ae35735d/68747470733a2f2f696d672e736869656c64732e696f2f6868766d2f696e6469676f7068702f636172742e7376673f7374796c653d666c61742d737175617265)](http://hhvm.h4cc.de/package/indigophp/cart)[![Total Downloads](https://camo.githubusercontent.com/1390abdd7bd20929eaeaea1b3058f119f1d18869aaee0eaa493b9fe95a917311/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696e6469676f7068702f636172742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/indigophp/cart)[![Dependency Status](https://camo.githubusercontent.com/873e9a92f5e90ae526f93dc07fb2befd55f8133d8265594f39823db422618983/68747470733a2f2f696d672e736869656c64732e696f2f76657273696f6e6579652f642f7068702f696e6469676f7068703a636172742e7376673f7374796c653d666c61742d737175617265)](https://www.versioneye.com/php/indigophp:cart)

**Cart abstraction layer.**

Install
-------

[](#install)

Via Composer

```
$ composer require indigophp/cart
```

Usage
-----

[](#usage)

To see a proof of concept implementation, check [this](https://github.com/indigophp/simple-cart) library.

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

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

$cart = new Cart;

$cart->addItem(new 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');

$store = new Store;
$store->save($cart);
```

Get existing cart:

```
use Indigo\Cart\Store;

$store = new Store;
$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/cart/contributors)

License
-------

[](#license)

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

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity59

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.

###  Release Activity

Cadence

Every ~65 days

Total

2

Last Release

4250d ago

Major Versions

v1.0.0 → v2.0.02014-09-22

### 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 (116 commits)")

---

Tags

cartshopping

###  Code Quality

TestsCodeception

### Embed Badge

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

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

###  Alternatives

[darryldecode/cart

Laravel 5 Shopping cart

1.4k1.7M7](/packages/darryldecode-cart)[lukepolo/laracart

A simple cart for Laravel

583135.4k1](/packages/lukepolo-laracart)[sylius/sylius-standard

Starting point for projects powered by Sylius eCommerce.

271291.3k](/packages/sylius-sylius-standard)[jackiedo/cart

A package used to create and manage carts (such as shopping, recently viewed, compared items...) in Laravel application.

20852.7k](/packages/jackiedo-cart)[binafy/laravel-cart

Laravel Cart is a customizable package for adding shopping cart functionality to Laravel applications

40445.9k](/packages/binafy-laravel-cart)[anam/phpcart

Simple framework agnostic shopping cart

12115.4k](/packages/anam-phpcart)

PHPackages © 2026

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