setono / sylius-abandoned-cart-plugin
Reengage customers who abandoned their cart in Sylius
Fund package maintenance!
Setono
Installs: 20 960
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 4
Open Issues: 4
Type:sylius-plugin
pkg:composer/setono/sylius-abandoned-cart-plugin
Requires
- php: >=8.1
- ext-hash: *
- doctrine/orm: ^2.0 || ^3.0
- doctrine/persistence: ^2.5 || ^3.0
- knplabs/knp-menu: ^3.3
- ocramius/doctrine-batch-utils: ^2.4
- psr/event-dispatcher: ^1.0
- psr/log: ^1.1 || ^2.0 || ^3.0
- setono/composite-compiler-pass: ^1.2
- setono/doctrine-orm-trait: ^1.2
- sylius/channel: ^1.0
- sylius/core: ^1.0
- sylius/core-bundle: ^1.0
- sylius/mailer-bundle: ^1.0 || ^2.0
- sylius/order: ^1.0
- sylius/resource-bundle: ^1.6
- sylius/ui-bundle: ^1.0
- symfony/config: ^6.4
- symfony/console: ^6.4
- symfony/dependency-injection: ^6.4
- symfony/event-dispatcher: ^6.4
- symfony/form: ^6.4
- symfony/http-foundation: ^6.4
- symfony/routing: ^6.4
- symfony/validator: ^6.4
- symfony/workflow: ^6.4
- twig/twig: ^2.15 || ^3.0
- webmozart/assert: ^1.12
Requires (Dev)
- api-platform/core: ^2.7.16
- babdev/pagerfanta-bundle: ^3.8
- behat/behat: ^3.14
- dama/doctrine-test-bundle: ^8.2
- doctrine/doctrine-bundle: ^2.11
- jms/serializer-bundle: ^4.2
- lexik/jwt-authentication-bundle: ^2.17
- setono/sylius-plugin-pack: ~1.14.4
- sylius-labs/polyfill-symfony-security: ^1.1.2
- symfony/browser-kit: ^6.4
- symfony/css-selector: ^6.4
- symfony/debug-bundle: ^6.4
- symfony/dotenv: ^6.4
- symfony/intl: ^6.4
- symfony/property-info: ^6.4
- symfony/serializer: ^6.4
- symfony/translation: ^6.4.3
- symfony/web-profiler-bundle: ^6.4
- symfony/webpack-encore-bundle: ^1.17.2
- willdurand/negotiation: ^3.1
This package is auto-updated.
Last update: 2026-02-25 13:15:52 UTC
README
Installation
composer require setono/sylius-abandoned-cart-plugin
Add bundle to config/bundles.php
Make sure you add it before SyliusGridBundle, otherwise you'll get
You have requested a non-existent parameter "setono_sylius_abandoned_cart.model.notification.class". exception.
<?php // config/bundles.php return [ // ... Setono\SyliusAbandonedCartPlugin\SetonoSyliusAbandonedCartPlugin::class => ['all' => true], Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true], // ... ];
Configure plugin
# config/packages/setono_sylius_abandoned_cart.yaml setono_sylius_abandoned_cart: # A secret salt used to generate secure unsubscribe URL hashes (SHA256). Change this in production. salt: your_secret_salt
Configure routes
# config/routes/setono_sylius_abandoned_cart.yaml setono_sylius_abandoned_cart: resource: "@SetonoSyliusAbandonedCartPlugin/Resources/config/routes.yaml"
Install assets
bin/console assets:install
Update your schema
# Generate and edit migration bin/console doctrine:migrations:diff # Then apply migration bin/console doctrine:migrations:migrate
Add cronjobs
The plugin requires two commands to run on a regular basis:
# Create notifications for idle carts (should run frequently, e.g., every 5 minutes) bin/console setono:sylius-abandoned-cart:create-notifications # Process pending notifications and send emails bin/console setono:sylius-abandoned-cart:process-notifications
The create-notifications command finds carts that have been idle for the configured threshold and creates notification records for them. The process-notifications command then sends the actual emails.
You can test the create-notifications command without persisting anything:
bin/console setono:sylius-abandoned-cart:create-notifications --dry-run
To clean up old notifications, run the prune command (e.g., daily):
bin/console setono:sylius-abandoned-cart:prune-notifications
Configuration options
# config/packages/setono_sylius_abandoned_cart.yaml setono_sylius_abandoned_cart: salt: your_secret_salt # Minutes before a cart is considered idle (default: 60) idle_threshold: 60 # Lookback window in minutes - only carts that became idle within this window # will be selected for notification creation. This limits the number of # notifications created per command run. (default: 15) # Important: Run the create-notifications command more frequently than this value lookback_window: 15 # Prune notifications older than this many minutes (default: 43200 = 30 days) prune_older_than: 43200 eligibility_checkers: # Skip customers who actively unsubscribed (default: true) unsubscribed_customer: true # Only notify customers subscribed to the newsletter (default: false) subscribed_to_newsletter: false