Skip to content

Send abandoned cart emails to customers who left their carts in your store

License

Notifications You must be signed in to change notification settings

Setono/SyliusAbandonedCartPlugin

Repository files navigation

Setono SyliusAbandonedCartPlugin

Latest Version Software License Build Status Code Coverage

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],
];

Configure plugin

# config/packages/setono_sylius_abandoned_cart.yaml
imports:
    - { resource: "@SetonoSyliusAbandonedCartPlugin/Resources/config/app/config.yaml" }

setono_sylius_abandoned_cart:
    # When unsubscribing a customer a hash is used to prevent false unsubscribes. This hash is generated using this salt.
    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 cronjob

The following command should run on a regular basis:

bin/console setono:sylius-abandoned-cart:process

also, if you want to prune the notifications table you can run:

bin/console setono:sylius-abandoned-cart:prune