phil / commerce-promotions-bundle
Promotions for a Symfony shop on phil/commerce-bundle: a share or amount off, N for X, bundle prices, free shipping, codes in batches, uses per customer.
Package info
github.com/parler-haut-interagir-librement/commerce-promotions-bundle
Type:symfony-bundle
pkg:composer/phil/commerce-promotions-bundle
Requires
- php: >=8.5
- ext-mbstring: *
- doctrine/orm: ^3.7
- phil/commerce-bundle: ^0.2@dev || ^0.3@dev
- phil/commerce-catalog-bundle: ^0.1@dev
- phil/ddd-bundle: ^0.1@dev
- phil/doctrine-behaviours: ^0.2@dev || ^0.3@dev
- phil/locale-dimensions: ^0.1@dev
- phil/money: ^0.1@dev
- psr/clock: ^1.0
- symfony/config: ^8.2
- symfony/dependency-injection: ^8.2
- symfony/translation-contracts: ^3.6
Requires (Dev)
- doctrine/dbal: ^4.5
- doctrine/doctrine-bundle: ^3.3
- doctrine/persistence: ^4.1
- phpunit/phpunit: ^13.4
- psr/log: ^3.0
- symfony/clock: ^8.2
- symfony/event-dispatcher: ^8.2
- symfony/framework-bundle: ^8.2
- symfony/http-kernel: ^8.2
Suggests
- phil/commerce-logistics-bundle: For the delivery charges a free shipping waives
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-21 03:05:22 UTC
README
Promotions for a store built on phil/commerce-bundle and its catalogue: a share off, an amount off, N for X, bundle prices and free shipping.
phil/commerce-promotions-bundle is the promotions module of phil/commerce-bundle, on the products of
phil/commerce-catalog-bundle. A promotion gives a share off each eligible line, an amount off spread over them, N
units for the price of X, a price for each complete bundle of product groups, or the delivery charge waived. It
applies per channel, customer group, period, products and the products it excludes, code, uses in all and per
customer, and products the customer already owns. Promotions apply in the order their after lists set, and never
combine with those they are incompatible with. Labels are translated; with DoctrineBundle, all of it is stored.
It is for a store that sells from a catalogue and runs sales, bundles and coupons. Codes used without the catalogue — donations, tickets, memberships — are another package's.
It is a Symfony bundle that refuses to load without the core and the catalogue. Installing it is enabling it.
It plugs into the core's ports and nothing else: promotions run as an OrderProcessor ahead of the core's taxes, and
free shipping as a second one after the processor that computes the delivery charge.
Status
| Part | State |
|---|---|
| Share off, amount off, N for X | Implemented and tested |
| Bundle prices, one line per product | Implemented and tested |
| Free shipping, per delivery method | Implemented and tested |
Exclusions, incompatibilities, order by after |
Implemented and tested |
| Uses per customer, products owned | Implemented and tested |
| Codes in batches, uses counted once per order | Implemented and tested |
| Translated labels | Implemented and tested |
| Storage on Doctrine | Implemented and tested |
| Buy X get Y across two lists, campaigns with a budget, conditions from a rules package | Not started |
Documentation
| Document | What it covers |
|---|---|
| Installation | Requirements, installing and registering the module beside the core and the catalogue. |
| Configuration | The locales labels are translated in. |
| Promotions | What a promotion gives, when it applies, how promotions add up, codes and uses, storage. |
| Extension points | What an application implements, configures, replaces or relies on. |
| Testing | How the module is tested, and how to run its tests and benchmarks. |
| Reference | Every public type of the module. |
Quick start
composer require phil/commerce-bundle phil/commerce-catalog-bundle phil/commerce-promotions-bundle
// config/bundles.php return [ // ... Phil\CommerceBundle\PhilCommerceBundle::class => ['all' => true], Phil\CommerceCatalogBundle\PhilCommerceCatalogBundle::class => ['all' => true], Phil\CommercePromotionsBundle\PhilCommercePromotionsBundle::class => ['all' => true], ];
Requirements
PHP 8.5 or later with ext-mbstring; phil/commerce-bundle, phil/commerce-catalog-bundle, phil/ddd-bundle,
phil/doctrine-behaviours, phil/locale-dimensions and phil/money 0.1; Doctrine ORM 3.7; psr/clock 1.0, whose
clock the application provides; symfony/config and symfony/dependency-injection 8.2 or later;
symfony/translation-contracts 3.6 or later.
Contributing
Contributions are welcome on the PHIL monorepo: read the contribution guide and the code of conduct. Report a vulnerability privately, as the security policy explains, never in a public issue.
License
MIT, © Philippe Gamache, doing business as Le Gnome Archiviste; a Parler Haut Interagir Librement project. See LICENSE.