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

ActiveSymfony-bundle[Framework](/categories/framework)

c975l/shop-bundle
=================

Shop Bundle for eCommerce with Symfony

v1.11.4(3w ago)1387MITPHPPHP &gt;=8.0

Since Sep 14Pushed 3w ago1 watchersCompare

[ Source](https://github.com/975L/ShopBundle)[ Packagist](https://packagist.org/packages/c975l/shop-bundle)[ Docs](https://github.com/975L/ShopBundle)[ Fund](https://buymeacoff.ee/laurentmarquet)[ Fund](https://opencollective.com/laurent-marquet)[ RSS](/packages/c975l-shop-bundle/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependencies (40)Versions (103)Used By (0)

ShopBundle
==========

[](#shopbundle)

Shop Bundle for eCommerce with Symfony

**BUNDLE UNDER DEVELOPMENT, USE AT YOUR OWN RISKS**

With this bundle, you'll be able to manage a shop + crowdfunding.

\## Installation

First, launch `composer require c975l/shop-bundle` to install the bundle.

Create database tables : `php bin/console make:migration` and `php bin/console doctrine:migrations:migrate`.

Create folders `public/medias/`, `public/downloads/` and `private` at your root level and add them to your `.gitignore` file.

Upgrading
---------

[](#upgrading)

When upgrading between major versions, please refer to the [UPGRADE.md](UPGRADE.md) guide for detailed migration instructions and breaking changes.

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

[](#configuration)

The bundle relies on the use of `App\Entity\User`. If you haven't, create it with `php bin/console make:user`. Then add one and give it `ROLE_ADMIN`. You can use `php bin/console security:hash-password` to hash the password.

Create a login form/logout route: `php bin/console make:security:form-login`. Then adapt to your needs.

You may launch `php bin/console doctrine:schema:validate` to check missing relations and them to your User class.

Add the following configuration in the different files:

```
# config/packages/security.yaml
security:
    firewalls:
        main:
            logout:
                path: app_logout
    access_control:
        - { path: ^/shop/management, roles: ROLE_ADMIN }
```

```
# config/packages/vich_uploader.yaml
vich_uploader:
    db_driver: orm

    metadata:
        type: attribute

    mappings:
        products:
            uri_prefix: '' # path added in ShopMediaNamer
            upload_destination: '%kernel.project_dir%/public/medias/shop/products'
            namer: c975L\ShopBundle\Namer\ShopMediaNamer
            inject_on_load: false
            delete_on_update: true
            delete_on_remove: true
        productItems:
            uri_prefix: '' # path added in ShopMediaNamer
            upload_destination: '%kernel.project_dir%/public/medias/shop/items'
            namer: c975L\ShopBundle\Namer\ShopMediaNamer
            inject_on_load: false
            delete_on_update: true
            delete_on_remove: true
        crowdfundings:
            uri_prefix: '' # path added in ShopMediaNamer
            upload_destination: '%kernel.project_dir%/public/medias/shop/crowdfundings'
            namer: c975L\ShopBundle\Namer\ShopMediaNamer
            inject_on_load: false
            delete_on_update: true
            delete_on_remove: true
        crowdfundingsCounterparts:
            uri_prefix: '' # path added in ShopMediaNamer
            upload_destination: '%kernel.project_dir%/public/medias/shop/counterparts'
            namer: c975L\ShopBundle\Namer\ShopMediaNamer
            inject_on_load: false
            delete_on_update: true
            delete_on_remove: true
```

```
# config/routes.yaml
c975_l_shop:
    resource: "@c975LShopBundle/"
    type:     attribute
    prefix:   /
```

```
# config/routes/easyadmin.yaml
easyadmin:
    resource: .
    type: easyadmin.routes
```

Configure the webhook in Stripe dashboard
-----------------------------------------

[](#configure-the-webhook-in-stripe-dashboard)

Create a Stripe account if not:

1. Sign in to your [Stripe Dashboard](https://dashboard.stripe.com/)
2. Navigate to Developers &gt; Webhooks
3. Click "Add endpoint"
4. Select the event `checkout.session.completed`
5. Enter your webhook URL ()
6. Copy the webhook signing secret and add it to your environment variables `config/config_bundles.yaml` -&gt; `stripeWebhookSecret`
7. Test the endpoint to ensure proper configuration

This webhook allows Stripe to notify your application when payments are completed, ensuring order processing even if customers close their browser after payment.

Create the configuration file `config/config_bundles.yaml` with these settings:

```
c975LShop:
    name: 'My Shop' # Name of the shop
    roleNeeded: 'ROLE_ADMIN' # Role needed to access shop management
    from: 'contactp@example.com' # Email address for sending emails
    fromName: 'My Shop' # Sender name
    replyTo: 'contact@example.com' # Reply-to email address
    replyToName: 'My Shop' # Reply-to name
    currency: 'eur' # ISO currency code
    shipping: 500 # Shipping cost in cents (5.00)
    shippingFree: 10000 # Free shipping threshold (100.00)
    sitemapBaseUrl: 'https://example.com'  # Base URL for sitemap
    stripeSecret: 'STRIPE_SECRET' # Stripe secret key
    stripeWebhookSecret: 'STRIPE_WEBHOOK_SECRET' # Stripe webhook secret
    touUrl: 'https://example.com/terms-of-use' # Terms of use URL
    tosUrl: 'https://example.com/terms-of-sales' # Terms of sales URL
```

Then launch configuration process `php bin/console config:create`.

Stimulus vcontrollers
---------------------

[](#stimulus-vcontrollers)

In `assets/bootstrap.js`, add the following code:

```
import c975lShopBasket from '/bundles/c975lshop/js/basket.js';
import c975lShopLottery from '/bundles/c975lshop/js/lottery.js';

app.register("basket", c975lShopBasket);
app.register("lottery", c975lShopLottery);
```

CSP
---

[](#csp)

Adapts your CSP to allow:

`script-src: 'unsafe-inline'` et `form-action '*'`

CSS
---

[](#css)

Add `@import url("/bundles/c975lshop/css/styles.min.css");` to your `assets/app.css` file.

Urls
----

[](#urls)

You should be able to use your shop + Management with the following urls:

- Shop
- Management:

Components
----------

[](#components)

You can use `` to display a slider using `product.medias`.

You can use `` to display a card using `product` data.

Useful Commands
---------------

[](#useful-commands)

The `basket.contentflags` has multiples values depending on its content.

The `basket.status` are the following: new, validated, paid, downloaded, shipped, finished

Run this Command `php bin/console shop:downloads:delete` once a day to delete files made available at download.

Run this Command `php bin/console shop:products:position` once a day to correct position and keep a 5 gap between them.

Run this Command `php bin/console shop:baskets:delete` once a day to delete unvalidated baskets (status new and creation &gt; 14 days).

Run this Command `php bin/console shop:media:delete` once a day to remove physical ProdutItemMedia not deleted when the ProductItem is deleted (see TODO below)

Run this Command `php bin/console shop:affinity:calculate` once a day to calculate product affinities

For creating the sitemap, you can run `php bin/console shop:sitemaps:create` thath will give a `public/sitemap-shop.xml` that you can add to your `sitemap-index.xml` file or run the following:

```
    //Creates the sitemap for pages managed by Shop
    public function createSitemapShop($output)
    {
        $command = $this->getApplication()->find('shop:sitemaps:create');
        $inputArray = new ArrayInput([]);
        $command->run($inputArray, $output);
    }
```

Entities structure and nesting
------------------------------

[](#entities-structure-and-nesting)

- Product \[Collection\]

    - ProductMedia \[Collection\]
    - ProductItem \[Collection\]
        - ProductItemMedia \[One\]
        - ProductItemFile \[One\]
- Crowdfunding \[Collection\]

    - CrowdfundingMedia \[Collection\]
    - CrowdfundingVideo \[Collection\]
    - CrowdfundingCounterpart \[Collection\]
        - CrowdfundingCounterpartMedia \[One\]
    - CrowdfundingNews \[Collection\]
    - CrowdfundingContributor \[Collection\]
        - CrowdfundingContributorCounterpart \[Collection\]
- Lottery \[Collection\]

    - LotteryPrize \[Collection\]
    - LotteryTickets \[Collection\]

TODO
----

[](#todo)

In `src/Listener/ProductItemListener.php` we need to create an empty `ProductItemMedia|ProductItemFile` if none is added, otherwise we can't add one afterwards. The physical ProdutItemMedia is not deleted when the ProductItem is deleted, but the link is removed. See `ProductItemListener->prePersist()`. Furthermore, need to create ProductItem without Meida/File first.

###  Health Score

55

—

FairBetter than 97% of packages

Maintenance95

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity85

Battle-tested with a long release history

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

Recently: every ~16 days

Total

101

Last Release

22d ago

Major Versions

v0.31 → v1.02025-05-23

PHP version history (3 changes)v0.1PHP &gt;=5.5.9

v0.1.2PHP ^7

v0.2PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/5679e828a48e37afabd92da60ab8d78bf65a3bedc0f618ef3fddf92082840f52?d=identicon)[Laurent3170](/maintainers/Laurent3170)

---

Top Contributors

[![LaurentMarquet](https://avatars.githubusercontent.com/u/16478286?v=4)](https://github.com/LaurentMarquet "LaurentMarquet (104 commits)")

---

Tags

symfonybundle

### Embed Badge

![Health badge](/badges/c975l-shop-bundle/health.svg)

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

###  Alternatives

[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M378](/packages/easycorp-easyadmin-bundle)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M464](/packages/pimcore-pimcore)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1615.6k12](/packages/2lenet-crudit-bundle)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9317.2k55](/packages/open-dxp-opendxp)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.8M712](/packages/sylius-sylius)

PHPackages © 2026

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