PHPackages                             abderrahimghazali/sylius-upsell-plugin - 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. abderrahimghazali/sylius-upsell-plugin

ActiveSylius-plugin

abderrahimghazali/sylius-upsell-plugin
======================================

Post-purchase upsell and cross-sell plugin for Sylius 2.x — Frequently Bought Together, one-click add-all-to-cart

v2.1.0(1mo ago)120↑2600%MITPHPPHP ^8.2CI passing

Since Mar 28Pushed 1mo agoCompare

[ Source](https://github.com/abderrahimghazali/sylius-upsell-plugin)[ Packagist](https://packagist.org/packages/abderrahimghazali/sylius-upsell-plugin)[ Docs](https://github.com/abderrahimghazali/sylius-upsell-plugin)[ RSS](/packages/abderrahimghazali-sylius-upsell-plugin/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

 [    ![Sylius Logo](https://camo.githubusercontent.com/ea9dddc934264aa7ec01cf3202c500f3d8b04448bce2571bdc74230efddda88f/68747470733a2f2f6d656469612e73796c6975732e636f6d2f73796c6975732d6c6f676f2d3830302e706e67)  ](https://sylius.com)

Sylius Upsell Plugin
====================

[](#sylius-upsell-plugin)

 Post-purchase upsell and cross-sell plugin for [Sylius 2.x](https://sylius.com) stores — Frequently Bought Together, checkout upsell modals, and one-click add-all-to-cart.

 [![CI](https://github.com/abderrahimghazali/sylius-upsell-plugin/actions/workflows/ci.yaml/badge.svg)](https://github.com/abderrahimghazali/sylius-upsell-plugin/actions/workflows/ci.yaml) [![Latest Version](https://camo.githubusercontent.com/8c2a10158b1b6759c14a3164824e45a506ca5469af70977a3aebdee23c0bd7cc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6162646572726168696d6768617a616c692f73796c6975732d757073656c6c2d706c7567696e2e737667)](https://packagist.org/packages/abderrahimghazali/sylius-upsell-plugin) [![PHP Version](https://camo.githubusercontent.com/91ac6a59ac4a099afa3dca8c66995c64e9915b13c1d0ee107c1a230bda69d94a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6162646572726168696d6768617a616c692f73796c6975732d757073656c6c2d706c7567696e2e737667)](https://packagist.org/packages/abderrahimghazali/sylius-upsell-plugin) [![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE) [![Sylius 2.x](https://camo.githubusercontent.com/47390b9b61d6f22d062322df61d2d225ceaf33f7bb75b99592c7ba766049f3e5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73796c6975732d322e782d677265656e2e737667)](https://packagist.org/packages/abderrahimghazali/sylius-upsell-plugin) [![Symfony 7.x](https://camo.githubusercontent.com/fe777aec93f146d83db2752ebd66562c8d4d1be48fa4a1477c51c0dbab74e381/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73796d666f6e792d372e782d626c61636b2e737667)](https://packagist.org/packages/abderrahimghazali/sylius-upsell-plugin) [![PHPStan Level 7](https://camo.githubusercontent.com/aea6993733cd63f8c0509bd208548ef02a3a2459c5e5c25230c62866ad483b7f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230372d627269676874677265656e2e737667)](https://camo.githubusercontent.com/aea6993733cd63f8c0509bd208548ef02a3a2459c5e5c25230c62866ad483b7f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230372d627269676874677265656e2e737667)

---

Screenshots
-----------

[](#screenshots)

### Admin — Upsell Offers Grid

[](#admin--upsell-offers-grid)

[![Admin Offers Grid](docs/images/admin-offers-grid.png)](docs/images/admin-offers-grid.png)

### Admin — Upsell Offer Form

[](#admin--upsell-offer-form)

[![Admin Offer Form](docs/images/admin-offer-form.png)](docs/images/admin-offer-form.png)

### Shop — Checkout Upsell Modal

[](#shop--checkout-upsell-modal)

[![Checkout Upsell Modal](docs/images/checkout-upsell-modal.png)](docs/images/checkout-upsell-modal.png)

### Admin — Upsell Analytics Dashboard

[](#admin--upsell-analytics-dashboard)

[![Admin Analytics](docs/images/admin-analytics.png)](docs/images/admin-analytics.png)

Features
--------

[](#features)

- **Frequently Bought Together section** on every product page with manual or algorithmic product suggestions
- **One-click add-all-to-cart** for the entire FBT bundle
- **Algorithmic co-purchase detection** from order history with configurable thresholds
- **Checkout upsell modal** — intercepts "Place order" with a special offer before completing the order
- **Trigger product targeting** — tie offers to specific products in the cart, or use catch-all
- **Discount percentage** — upsell product added to cart at discounted price
- **Customizable copy** — headline, body, CTA label, and decline label per offer
- **Date scheduling** — start and end dates for time-limited offers
- **Priority system** — control which offer wins when multiple match
- **Admin CRUD** for upsell offers under Marketing, and global FBT settings under Configuration
- **Drag-and-drop reordering** of manual FBT relations with optional discount badges
- **Analytics dashboard** — impressions, acceptance rate, extra revenue, daily chart (Chart.js)
- **Impression tracking** — automatic for both FBT and checkout upsell (shown / accepted / declined)

Requirements
------------

[](#requirements)

- Sylius 2.1+
- Symfony 7.0+
- PHP 8.2+

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

[](#installation)

1. Require the plugin:

```
composer require abderrahimghazali/sylius-upsell-plugin
```

2. Register the bundle in `config/bundles.php` (if not auto-discovered):

```
return [
    // ...
    Abderrahim\SyliusUpsellPlugin\SyliusUpsellPlugin::class => ['all' => true],
];
```

3. Import routes — create `config/routes/sylius_upsell.yaml`:

```
sylius_upsell:
    resource: '@SyliusUpsellPlugin/config/routes.yaml'
```

4. Generate and run the migration:

```
bin/console doctrine:migrations:diff
bin/console doctrine:migrations:migrate
```

5. Register the Stimulus controllers in `assets/shop/controllers.json`:

```
{
    "controllers": {
        "@abderrahimghazali/sylius-upsell-plugin": {
            "fbt": {
                "enabled": true,
                "fetch": "eager"
            },
            "post-purchase": {
                "enabled": true,
                "fetch": "eager"
            }
        }
    }
}
```

6. Symlink the plugin assets and rebuild:

Add to your project's `package.json` dependencies:

```
"@abderrahimghazali/sylius-upsell-plugin": "file:vendor/abderrahimghazali/sylius-upsell-plugin/assets"
```

Then install and rebuild:

```
npm install
npm run build
```

Entity: UpsellRelation
----------------------

[](#entity-upsellrelation)

FieldTypeDescription`sourceProduct`ManyToOne (Product)The product page where the FBT section appears`relatedProduct`ManyToOne (Product)The product suggested alongside the source`position`intDisplay order (lower = first)`discount`int?Optional discount percentage for the related product`createdAt`datetimeTimestamp of creationEntity: UpsellOffer
-------------------

[](#entity-upselloffer)

FieldTypeDescription`name`stringAdmin label for the offer`enabled`booleanActive/inactive toggle`triggerProduct`ManyToOne (Product)The purchased product that triggers this offer`offerProduct`ManyToOne (Product)The product offered in the upsell modal`offerVariant`ManyToOne (ProductVariant)?Optional specific variant to offer`discountPercent`intDiscount percentage shown in the modal`headline`stringModal heading (default: "Wait! A special offer just for you")`body`text?Optional body text`ctaLabel`stringAccept button text (default: "Yes, add it!")`declineLabel`stringDecline button text (default: "No thanks")`priority`intHigher = shown first when multiple offers match`startsAt`datetime?Optional start date`endsAt`datetime?Optional end dateEntity: UpsellConfiguration
---------------------------

[](#entity-upsellconfiguration)

FieldTypeDescription`enabled`booleanGlobal FBT feature toggle`minCoPurchaseThreshold`intMinimum co-purchase count for algorithmic suggestions (default: 3)`maxProductsShown`intMaximum products in the FBT section (default: 4)`sectionTitle`stringHeading text (default: "Frequently bought together")`showDiscountBadge`booleanShow/hide discount badges on FBT products`fallbackStrategy`string`algorithmic`, `manual_only`, or `disabled`Architecture
------------

[](#architecture)

```
src/
├── Controller/
│   ├── Admin/
│   │   ├── UpsellConfigurationController.php    # Global FBT settings
│   │   └── UpsellOfferController.php            # CRUD for upsell offers
│   └── Shop/
│       ├── ImpressionController.php             # Impression tracking API
│       └── PostPurchaseController.php           # Accept/decline offer API
├── DependencyInjection/
│   ├── Configuration.php
│   └── SyliusUpsellExtension.php                # Prepends resources, grids, hooks
├── Entity/
│   ├── UpsellConfiguration.php
│   ├── UpsellImpression.php
│   ├── UpsellOffer.php
│   ├── UpsellOfferInterface.php
│   ├── UpsellRelation.php
│   └── UpsellRelationInterface.php
├── EventListener/
│   ├── AdminMenuListener.php                    # Marketing menu items
│   └── ProductFormListener.php                  # FBT tab on product form
├── Form/Type/
│   ├── ProductUpsellType.php                    # Product FBT relations form
│   ├── UpsellConfigurationType.php              # Global settings form
│   ├── UpsellOfferType.php                      # Upsell offer form
│   └── UpsellRelationType.php                   # Single relation row form
├── Repository/
│   ├── UpsellImpressionRepository.php           # Analytics queries
│   ├── UpsellOfferRepository.php                # Active offers query
│   └── UpsellRelationRepository.php             # Relations by product
├── Service/
│   ├── FrequentlyBoughtTogetherResolver.php     # FBT logic (manual + algorithmic)
│   ├── PostPurchaseOfferResolver.php            # Best matching offer for an order
│   ├── UpsellAnalyticsService.php               # Impression recording + analytics
│   └── UpsellConfigurationProvider.php          # Cached config access
├── Twig/UpsellExtension.php                     # Twig function bridge
└── SyliusUpsellPlugin.php                       # Bundle class

assets/
├── controllers/
│   ├── fbt-controller.js                        # Add-all-to-cart Stimulus controller
│   └── post-purchase-controller.js              # Upsell modal Stimulus controller
└── package.json

templates/
├── Admin/
│   ├── analytics.html.twig                      # Analytics dashboard with Chart.js
│   ├── configuration.html.twig                  # Global settings page
│   └── upsell_offer/
│       ├── create.html.twig
│       ├── update.html.twig
│       └── grid/field/product.html.twig
└── Shop/
    ├── frequently_bought_together.html.twig     # FBT section on product page
    └── post_purchase_offer.html.twig            # Upsell modal after checkout

```

Testing
-------

[](#testing)

```
vendor/bin/phpunit
```

License
-------

[](#license)

MIT. See [LICENSE](LICENSE).

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance90

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

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

Unknown

Total

1

Last Release

46d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e1be9cf8e271987c350c614aa618f0e68c7f7409634e51f8c8fe105490899b0f?d=identicon)[abderrahim.ghazali](/maintainers/abderrahim.ghazali)

---

Top Contributors

[![abderrahimghazali](https://avatars.githubusercontent.com/u/12643883?v=4)](https://github.com/abderrahimghazali "abderrahimghazali (60 commits)")

---

Tags

analyticscross-sellecommercefrequently-bought-togetherphppost-purchasesyliussylius-pluginsymfonyupsellsyliusecommerceanalyticssylius-plugincross-sellUpsellfrequently-bought-togetherpost-purchase

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/abderrahimghazali-sylius-upsell-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/abderrahimghazali-sylius-upsell-plugin/health.svg)](https://phpackages.com/packages/abderrahimghazali-sylius-upsell-plugin)
```

###  Alternatives

[sylius/invoicing-plugin

Invoicing plugin for Sylius.

901.0M2](/packages/sylius-invoicing-plugin)[synolia/sylius-scheduler-command-plugin

Scheduler Command Plugin.

34361.5k](/packages/synolia-sylius-scheduler-command-plugin)[sylius/taxonomy-bundle

Flexible categorization system for Symfony.

26388.2k7](/packages/sylius-taxonomy-bundle)[sylius/promotion-bundle

Manage ecommerce promotions system in your Symfony application.

21426.2k3](/packages/sylius-promotion-bundle)[sylius/inventory-bundle

Flexible inventory management for Symfony applications.

19176.7k4](/packages/sylius-inventory-bundle)[synolia/sylius-akeneo-plugin

Akeneo connector for Sylius.

2696.0k](/packages/synolia-sylius-akeneo-plugin)

PHPackages © 2026

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