composer require setono/sylius-abandoned-cart-pluginMake 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],
// ...
];# 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# config/routes/setono_sylius_abandoned_cart.yaml
setono_sylius_abandoned_cart:
resource: "@SetonoSyliusAbandonedCartPlugin/Resources/config/routes.yaml"bin/console assets:install# Generate and edit migration
bin/console doctrine:migrations:diff
# Then apply migration
bin/console doctrine:migrations:migrateThe 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-notificationsThe 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-runTo clean up old notifications, run the prune command (e.g., daily):
bin/console setono:sylius-abandoned-cart:prune-notifications# 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