PHPackages                             vaened/swift-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. vaened/swift-cart

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vaened/swift-cart
=================

The SwiftCart library is a powerful tool for managing shopping carts, invoicing, and product administration.

v1.0.0(1y ago)3124.4k—0.6%MITPHPPHP ^8.1CI passing

Since Aug 30Pushed 1y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (6)Versions (3)Used By (0)

Swift Cart
==========

[](#swift-cart)

[![Build Status](https://github.com/vaened/swift-cart/actions/workflows/tests.yml/badge.svg)](https://github.com/vaened/swift-cart/actions?query=workflow:Tests)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](license)

This library is a powerful tool that allows you to efficiently manage purchases, quotes, accounts, and more. With this library, you can effortlessly handle various aspects of a shopping cart, including adding products, taxes, fees, and discounts, and obtaining a detailed summary of the total amount to pay.

> This library is based on [vaened/php-price-engine](https://github.com/vaened/php-price-engine) for price management

```
// initialize cart
$taxes = Taxes::from([
    Inclusive::proportional(18, 'IGV')
]);

$cart = new ShoppingCart($taxes);

// add products
$mouse = $cart->push(Product::findOrFail(1), quantity: 2);

// assign individual charges and discounts
$mouse->add(
    Charge::proportional(percentage: 5)->named('Delivery'),
    Charge::fixed(amount: 2)->named('Random'),
);
$mouse->apply(
    Discount::proportional(percentage: 10)->named('NewUser')
);

// update quantity
$mouse->update(quantity: 3);

// assign global charges and discounts
$cart->addAsGlobal(
    Charge::fixed(amount: 2)->named('Express')
);
$cart->applyAsGlobal(
    Discount::proportional(percentage: 1)
);

// get summary
$cart->summary();
```

Installation
------------

[](#installation)

You can install the library using `composer`.

```
composer require vaened/swift-cart
```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance44

Moderate activity, may be stable

Popularity35

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Total

2

Last Release

441d ago

Major Versions

v0.1 → v1.0.02025-03-03

### Community

Maintainers

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

---

Top Contributors

[![vaened](https://avatars.githubusercontent.com/u/15077850?v=4)](https://github.com/vaened "vaened (53 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[whitecube/php-prices

A simple PHP library for complex monetary prices management

17168.4k7](/packages/whitecube-php-prices)[beacon-hq/bag

A comprehensive immutable value objects implementation

1789.1k3](/packages/beacon-hq-bag)[finller/laravel-money

Use Brick/Money in your Laravel app

1919.2k](/packages/finller-laravel-money)

PHPackages © 2026

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