PHPackages                             sinbadxiii/phalcon-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. sinbadxiii/phalcon-cart

ActiveLibrary[Framework](/categories/framework)

sinbadxiii/phalcon-cart
=======================

Phalcon package for shopping cart

1.3(4y ago)4562MITPHP

Since Nov 8Pushed 4y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (5)Used By (0)

Phalcon Shopping Cart
=====================

[](#phalcon-shopping-cart)

A simple shoppingcart implementation for Phalcon.

### Installation

[](#installation)

Install the package through Composer.

Run the Composer require command from the Terminal:

```
composer require sinbadxiii/phalcon-cart

```

How use
-------

[](#how-use)

Add in services

```
$di->set(
      'cart',
      function () use ($di) {
          return new Sinbadxiii\Phalcon\Cart\CartShopping(
              $di->getSession()
          );
      }
  );

```

or creating with name instance

```
$di->set(
      'compare',
      function () use ($di) {
          return new Sinbadxiii\Phalcon\Cart\CartShopping(
              $di->getSession(), 'compare'
          );
      }
  );

```

```
#add()
$this->cart->add('1', 'Product Name 1', 1, 100.99);

#update()
$rowId = '5d12249fdca4cb0fff77f49bbffc128c';
$this->cart->update($rowId, 10);

#remove()
$rowId = '5d12249fdca4cb0fff77f49bbffc128c';
$this->cart->remove($rowId);

#content()
$this->cart->content();

#destroy()
$this->cart->destroy();

#total() with Tax
$this->cart->total();

#total() without Tax
$this->cart->subtotal();

#count()
$this->cart->count();

#countTotal()
$this->cart->countTotal();

```

Instances
---------

[](#instances)

The packages supports multiple instances of the cart. The way this works is like this:

You can set the current instance of the cart by calling $this-&gt;cart-&gt;instance('newInstance'). From this moment, the active instance of the cart will be newInstance, so when you add, remove or get the content of the cart, you're work with the newInstance instance of the cart. If you want to switch instances, you just call $this-&gt;cart-&gt;instance('otherInstance') again, and you're working with the otherInstance again.

So a little example:

```
$this->cart->instance('shop')->add('100', 'Product #1', 1, 100.00);

// Get the content of the 'shop' cart
$this->cart->content();

$this->cart->instance('wishlist')->add('200', 'Product #2', 1, 20.00);

// Get the content of the 'wishlist' cart
$this->cart->content();

// If you want to get the content of the 'shopping' cart again
$this->cart->instance('shop')->content();

// And the count of the 'wishlist' cart again
$this->cart->instance('wishlist')->count();

```

> N.B. Keep in mind that the cart stays in the last set instance for as long as you don't set a different one during script execution.

> N.B.2 The default cart instance is called default, so when you're not using instances, $this-&gt;cart-&gt;content(); is the same as $this-&gt;cart-&gt;instance('shop')-&gt;content().

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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 ~207 days

Total

4

Last Release

1753d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d43ec6596bb88c8c2751c8839da5ddc9272ef1d482b67fcf686a1203b340044d?d=identicon)[sinbadxiii](/maintainers/sinbadxiii)

---

Top Contributors

[![sinbadxiii](https://avatars.githubusercontent.com/u/900273?v=4)](https://github.com/sinbadxiii "sinbadxiii (10 commits)")

---

Tags

phalconshoppingcart

### Embed Badge

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

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

###  Alternatives

[phalcon/cphalcon

Phalcon is an open source web framework delivered as a C extension for the PHP language providing high performance and lower resource consumption.

10.8k241.4k1](/packages/phalcon-cphalcon)[phalcon/devtools

This tools provide you useful scripts to generate code helping to develop faster and easy applications that use with Phalcon framework.

1.3k2.0M54](/packages/phalcon-devtools)[phalcon/incubator

Adapters, prototypes or functionality that can be potentially incorporated to the C-framework.

7222.9M81](/packages/phalcon-incubator)[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)[phalcon/migrations

Run and Generate DB Migrations with Phalcon Framework

29977.8k6](/packages/phalcon-migrations)[anayarojo/shoppingcart

Laravel Shoppingcart

57175.5k](/packages/anayarojo-shoppingcart)

PHPackages © 2026

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