PHPackages                             ggggino/skuskucart-bundle - 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. ggggino/skuskucart-bundle

ActiveSymfony-bundle

ggggino/skuskucart-bundle
=========================

This bundle aim to be a slim cart manager

2.1.1(6y ago)01172[1 issues](https://github.com/GGGGino/SkuskuCartBundle/issues)[1 PRs](https://github.com/GGGGino/SkuskuCartBundle/pulls)MITPHPPHP ^5.6|^7.0CI failing

Since Oct 10Pushed 6y ago1 watchersCompare

[ Source](https://github.com/GGGGino/SkuskuCartBundle)[ Packagist](https://packagist.org/packages/ggggino/skuskucart-bundle)[ Docs](https://github.com/GGGGino)[ RSS](/packages/ggggino-skuskucart-bundle/feed)WikiDiscussions master Synced yesterday

READMEChangelog (7)Dependencies (23)Versions (22)Used By (0)

SkuskuCartBundle
================

[](#skuskucartbundle)

[![Total Downloads](https://camo.githubusercontent.com/153fabd9c3ae9031abe91d438872d5a3242ed97704367c98f02e2dcd5bd242f7/68747470733a2f2f706f7365722e707567782e6f72672f67676767696e6f2f736b75736b75636172742d62756e646c652f646f776e6c6f616473)](https://packagist.org/packages/ggggino/skuskucart-bundle)[![Latest Stable Version](https://camo.githubusercontent.com/ffb31cc53b4325e97c88f0de984b999a2f712fc56a1402e6c956abe93f5e35d1/68747470733a2f2f706f7365722e707567782e6f72672f67676767696e6f2f736b75736b75636172742d62756e646c652f762f737461626c65)](https://packagist.org/packages/ggggino/skuskucart-bundle)[![Travis (.org)](https://camo.githubusercontent.com/8d83db5785617745b0cf7885aba5a11d631e2a9fa01fbbdd5917e5a9ea267367/68747470733a2f2f6170692e7472617669732d63692e636f6d2f47474747696e6f2f536b75736b754361727442756e646c652e737667)](https://camo.githubusercontent.com/8d83db5785617745b0cf7885aba5a11d631e2a9fa01fbbdd5917e5a9ea267367/68747470733a2f2f6170692e7472617669732d63692e636f6d2f47474747696e6f2f536b75736b754361727442756e646c652e737667)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/4bf2889d5d38ff8521e9c195f243f98145f51f3c473d330bc112383d14bc5e36/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f47474747696e6f2f536b75736b754361727442756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/GGGGino/SkuskuCartBundle/?branch=master)

Highly customizable cart management bundle for Symfony. The archievement of this cart manager is to do something like:

> **Add this *thing* to a *cart***

License
-------

[](#license)

[![License](https://camo.githubusercontent.com/99b4149f4f86656b3bafe5c9e455d08c910d48ed3cbf367d7f6c26d72485b4f8/68747470733a2f2f706f7365722e707567782e6f72672f67676767696e6f2f736b75736b75636172742d62756e646c652f6c6963656e7365)](LICENSE)

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

[](#installation)

**1** Add bundle to your vendor

```
composer require ggggino/skuskucart-bundle
```

**2** Register the bundle in `app/AppKernel.php`

```
$bundles = array(
    // ...

    // Multi step form
    new Craue\FormFlowBundle\CraueFormFlowBundle(),

    // Payment bundle
    new Payum\Bundle\PayumBundle\PayumBundle(),

    // Cart bundle
    new GGGGino\SkuskuCartBundle\GGGGinoSkuskuCartBundle(),
);
```

**3** Create at least one currency

```
bin/console ggggino_skusku:currency:create
```

**4** Set default locale and currency

```
parameters:
    locale: it
    currency: EUR
```

Configuration
-------------

[](#configuration)

Bundle complete configuration

```
# config.yml
ggggino_skuskucart:
    allow_anonymous_shop: false
    cart_mode: 'single_page'
    stepform:
        cart:
            form_type: GGGGino\SkuskuCartBundle\Form\CartFlowType\CartStep1FormType
            label: Step 1
        chosePayment:
            form_type: GGGGino\SkuskuCartBundle\Form\CartFlowType\CartStep2FormType
            label: Step 2
        payment:
            form_type: GGGGino\SkuskuCartBundle\Form\CartFlowType\CartStep3FormType
            label: Step 3
    templates:
        cart_layout: 'GGGGinoSkuskuCartBundle::cart_page.html.twig'
        done_layout: 'xxxBundle:xxx:xxx.html.twig'
```

Extra configs

```
# config.yml
parameters:
    locale: it
    currency: EUR
```

Add the target entities that replace the interfaces

```
# config.yml
doctrine:
    orm:
        resolve_target_entities:
              GGGGino\SkuskuCartBundle\Model\SkuskuProductInterface: GGGGino\SkuskuCartBundle\Entity\SkuskuProduct
              GGGGino\SkuskuCartBundle\Model\SkuskuCustomerInterface: GGGGino\SkuskuCartBundle\Entity\SkuskuUser
              GGGGino\SkuskuCartBundle\Model\SkuskuCurrencyInterface: GGGGino\SkuskuCartBundle\Entity\SkuskuCurrency
              GGGGino\SkuskuCartBundle\Model\SkuskuLangInterface: GGGGino\SkuskuCartBundle\Entity\SkuskuLanguage
```

Add the basics routes

```
# routing.yml
skusku:
    resource: "@GGGGinoSkuskuCartBundle/Controller/"
    type:     annotation
```

Use `resolve_target_entities` to replace the interface entities with the concrete ones

```
doctrine:
    orm:
        resolve_target_entities:
              GGGGino\SkuskuCartBundle\Model\SkuskuProductInterface: AppBundle\Entity\Product
              GGGGino\SkuskuCartBundle\Model\SkuskuCustomerInterface: AnotherBundle\Entity\User
              GGGGino\SkuskuCartBundle\Model\SkuskuCurrencyInterface: My\CustomBundle\Entity\Currency
              GGGGino\SkuskuCartBundle\Model\SkuskuLangInterface: ExtraBundle\Entity\Language
```

> Every class used must implements the right interface.

1. Currency

    ```
    use GGGGino\SkuskuCartBundle\Model\SkuskuCurrencyInterface;

    class Currency implements SkuskuCurrencyInterface
    {
    }
    ```
2. User

    ```
    use GGGGino\SkuskuCartBundle\Model\SkuskuCustomerInterface;

    class User implements SkuskuCustomerInterface
    {
    }
    ```
3. Product

    ```
    use GGGGino\SkuskuCartBundle\Model\SkuskuProductInterface;

    class Product implements SkuskuProductInterface
    {
    }
    ```
4. Language

    ```
    use GGGGino\SkuskuCartBundle\Model\SkuskuLangInterface;

    class Lang implements SkuskuLangInterface
    {
    }
    ```

> If you want an prebuilt entity you can extend their own base class.

1. Currency ```
    use GGGGino\SkuskuCartBundle\Model\SkuskuCurrencyBase;
    class Currency extends SkuskuCurrencyBase
    {
    }
    ```

Twig functions
--------------

[](#twig-functions)

### Print the cart preview

[](#print-the-cart-preview)

```
{{ render_preview_cart() }}
```

### Print the language choice block

[](#print-the-language-choice-block)

```
{{ render_lang_cart() }}
```

### Print the currency choice block

[](#print-the-currency-choice-block)

```
{{ render_currency_cart() }}
```

CartManager API
---------------

[](#cartmanager-api)

### Cart manager

[](#cart-manager)

Get the cart manager instance

```
use GGGGino\SkuskuCartBundle\Service\CartManager;
.
.
.
$cartManager = $this->get(CartManager::class);
```

### CartManager::persistCart(SkuskuCart $cart)

[](#cartmanagerpersistcartskuskucart-cart)

Add the cart to EntityManager

```
use GGGGino\SkuskuCartBundle\Model\SkuskuCart;
.
.
.
/** @var SkuskuCart $finalCart */
$finalCart = ...

$cartManager->persistCart($finalCart);
```

### CartManager::flushCart(SkuskuCart $cart);

[](#cartmanagerflushcartskuskucart-cart)

Flush the cart

```
$cartManager->flushCart($finalCart);
```

### CartManager::addProductToCart(SkuskuProductInterface $product, int $quantity)

[](#cartmanageraddproducttocartskuskuproductinterface-product-int-quantity)

Add some product to the cart

```
$quantity = 20;
$cartManager->addProductToCart($product, $quantity);
```

### CartManager::createNewCart(SkuskuCustomerInterface $customer = null)

[](#cartmanagercreatenewcartskuskucustomerinterface-customer--null)

Create new Cart from a given customer, if the customer is not passed is taken from the session

```
$cartManager->createNewCart($customer);
```

### CartManager::createNewOrderFromCart(SkuskuCart $cart)

[](#cartmanagercreateneworderfromcartskuskucart-cart)

Build a new Order from a given cart. Used for example when the payment gone good

```
$cartManager->createNewOrderFromCart($cart);
```

### Cart page

[](#cart-page)

> /cart

Commands
--------

[](#commands)

> bin/console ggggino\_skusku:cart:clear

Clear all the skuskutables

> bin/console ggggino\_skusku:currency:create

Create a row of the given entity - DEV

> bin/console ggggino\_skusku:doctor:db

Check if the installation procedure was successful

Configuration details
---------------------

[](#configuration-details)

You can decide if even the anonymous user can shop

```
# config.yml
ggggino_skuskucart:
    allow_anonymous_shop: false
```

Chose between use the default steps and create new ones, remember that for the "cart|chosePayment|payment" you can only override configs

```
# config.yml
ggggino_skuskucart:
    stepform:
        cart:
            form_type: GGGGino\SkuskuCartBundle\Form\CartFlowType\CartStep1FormType
            label: Step 1
        chosePayment:
            form_type: GGGGino\SkuskuCartBundle\Form\CartFlowType\CartStep2FormType
            label: Step 2
        payment:
            form_type: GGGGino\SkuskuCartBundle\Form\CartFlowType\CartStep3FormType
            label: Step 3
```

If you need more customization in the formstep you can override it. Your CartFlow needs only to inherit

```
# config.yml
ggggino_skuskucart:
    stepform_class: GGGGino\SkuskuCartBundle\Form\CartFlow
```

If you need to change the templates

```
# config.yml
ggggino_skuskucart:
    templates:
        cart_layout: 'GGGGinoSkuskuCartBundle::cart_page.html.twig'
        done_layout: 'xxxBundle:xxx:xxx.html.twig'
```

Events
------

[](#events)

NameConstantArgument passedDescriptionskusku\_cart.pre\_submit`CartFlow::PRE_SUBMIT``CartForm`Here you can modify entities or do custom action before the persistskusku\_cart.post\_submit`CartFlow::POST_SUBMIT``CartForm`Here you can do custom action after the persistskusku\_cart.post\_payment`CartFlow::POST_PAYMENT``SkuskuPayment`, $statusHere you can do "anything" after the payment responseskusku\_cart.pre\_persist\_order`CartFlow::PRE_PERSIST_ORDER``SkuskuOrder`Here you can manipulate the Order before the persistTemplates
---------

[](#templates)

NameArgumentsDefaultDescriptionskusku\_cart.templates.cart\_layoutForm, FormFlow`GGGGinoSkuskuCartBundle::cart_page.html.twig`Set the template that render the cart pageskusku\_cart.templates.done\_layoutStatus, PaymentnullSet the template used after the payment was doneTODO
----

[](#todo)

- API for creating cart
- Ordering stepform items

Test taken from:

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 89.2% 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 ~28 days

Recently: every ~7 days

Total

19

Last Release

2267d ago

Major Versions

1.0.17 → 2.0.12020-01-20

PHP version history (2 changes)1.0.0PHP ^7.0

1.0.6PHP ^5.6|^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/71ba17da078527d84402fef98be186df83af523d0896e98907904efea4336b5d?d=identicon)[ggggino](/maintainers/ggggino)

---

Top Contributors

[![GGGGino](https://avatars.githubusercontent.com/u/3227441?v=4)](https://github.com/GGGGino "GGGGino (91 commits)")[![DuccioGuazzelli](https://avatars.githubusercontent.com/u/29096339?v=4)](https://github.com/DuccioGuazzelli "DuccioGuazzelli (11 commits)")

---

Tags

bundlecartsymfonysymfonybundlecartsymfony4symfony3

### Embed Badge

![Health badge](/badges/ggggino-skuskucart-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/ggggino-skuskucart-bundle/health.svg)](https://phpackages.com/packages/ggggino-skuskucart-bundle)
```

###  Alternatives

[fsi/admin-bundle

FSi Admin Bundle. Admin generator for Symfony.

5849.2k7](/packages/fsi-admin-bundle)[ibrahimgunduz34/maria-bundle

A Rule Engine Implementation For Symfony Projects

151.1k](/packages/ibrahimgunduz34-maria-bundle)

PHPackages © 2026

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