# DfCartRecovery — Abandoned Cart Recovery for Shopware 6

> Overview DfCartRecovery brings abandoned cart recovery to Shopware 6 (Community Edition), a capability normally reserved for the Commercial plan: cart detection, up to 3 scheduled reminder emails, a unique discount…

- Page: <https://www.datafirefly.com/en/documentation/dfcartrecovery/>
- Language: en
- Last updated: 2026-07-22
- Other languages: [fr](https://www.datafirefly.com/documentation/dfcartrecovery/index.md), [es](https://www.datafirefly.com/es/documentation/dfcartrecovery/index.md), [de](https://www.datafirefly.com/de/documentation/dfcartrecovery/index.md), [it](https://www.datafirefly.com/it/documentation/dfcartrecovery/index.md), [pl](https://www.datafirefly.com/pl/documentation/dfcartrecovery/index.md), [nl](https://www.datafirefly.com/nl/documentation/dfcartrecovery/index.md), [pt](https://www.datafirefly.com/pt/documentation/dfcartrecovery/index.md)
- Index: <https://www.datafirefly.com/en/documentation/llms.txt>

## Overview

DfCartRecovery brings abandoned cart recovery to Shopware 6 (Community Edition), a capability normally reserved for the Commercial plan: cart detection, up to 3 scheduled reminder emails, a unique discount code per customer, a one-click cart restore link and tracking of recovered orders. No external service, no administration build: everything is configured in the plugin settings.

## Requirements

- Shopware 6.5, 6.6 or 6.7 (self-hosted Community Edition — Shopware Cloud SaaS not supported)
- PHP 8.1 or higher (8.2+ recommended)
- Active message consumer and scheduled task runner (Shopware's standard production recommendation)
- Working email sending on the shop (reminders go through Shopware's native mail service)

## Installation

1. Unzip the archive and place the `DfCartRecovery` folder in `custom/plugins/`.
2. From the Shopware root, run:

```
bin/console plugin:refresh
bin/console plugin:install --activate DfCartRecovery
bin/console cache:clear
```

The scheduled task `df_cart_recovery.process` is registered automatically and runs every 15 minutes. Make sure your workers are running:

```
bin/console scheduled-task:run
bin/console messenger:consume async low_priority
```

Installation creates the `df_cart_recovery` tracking table and the "Abandoned cart reminder (DataFirefly)" email template, pre-translated into EN, DE, FR, ES and IT.

## Configuration

Go to **Extensions → My extensions → DfCartRecovery → Configuration**. Three settings cards:

### General

- **Enable cart recovery** — the plugin's global switch.
- **Minimum cart value** — carts below this total are ignored (0 = no minimum).
- **Data retention (days)** — older tracking entries are deleted automatically (30 days by default, see the GDPR section).

### Reminder emails

- **Number of reminders** — 1, 2 or 3 (2 by default).
- **Reminder 1** — minutes after cart abandonment (60 by default, i.e. 1 hour).
- **Reminder 2** — minutes after reminder 1 (1440 by default, i.e. 24 hours).
- **Reminder 3** — minutes after reminder 2 (4320 by default, i.e. 72 hours).

The 1 h / +24 h / +72 h sequence is the proven email retargeting standard: keep it as a starting point, then adjust based on your recovery statistics.

### Discount voucher

- **Include a unique discount code** — enables individual code generation.
- **Promotion for generated codes** — select the Shopware promotion that will carry the codes (see below).
- **Send the code with reminder no.** — 2 by default: customers who return after the first email order without a discount.
- **Voucher code prefix** — CART by default; generated codes look like `CART-7F3A91B2`.

## Setting up the promotion for unique codes

1. In the Shopware admin, open **Marketing → Promotions** and create a promotion (or reuse an existing one).
2. In the general tab, enable **Individual promotion codes**.
3. Define the discount (percentage or amount), conditions and validity period as usual.
4. Activate the promotion, then select it in the plugin configuration.

The promotion must have individual codes enabled: the plugin inserts its generated codes into that list. Without this option, the codes sent by email will not be accepted at checkout.

## Customising the reminder email

The content is edited in **Settings → Email templates**, type "Abandoned cart reminder (DataFirefly)", for each shop language. Available Twig variables:

- `firstName` / `lastName` — the customer's first and last name
- `items` — cart items, each with `label` and `quantity`
- `total` and `currency` — cart total and currency code
- `recoveryUrl` — the cart restore link (place it on the call-to-action button)
- `voucherCode` — the unique discount code (empty when disabled or on reminders without a code: wrap its block in a Twig condition)
- `shopName` — the sales channel shop name
- `reminderNumber` — the current reminder number (1, 2 or 3)

## The restore link

Every email contains a unique link of the form `/df-cart-recovery/token`, generated on the customer's sales channel domain, in their language. On click, the plugin rebuilds the cart item by item, flags products that became unavailable with a storefront message, timestamps the click and redirects to the cart page. Invalid or expired links redirect to the home page with an explicit message.

## Recovery tracking

As soon as an order is placed, the plugin matches the customer's email against pending abandoned carts: the entry flips to "recovered" with the order id, the date and the number of reminders sent. Reminders stop immediately for that cart. The data lives in the `df_cart_recovery` table (tokens, statuses, clicks, linked orders) for your SQL or BI reporting.

## GDPR and data

- No data leaves your server; no third-party service is called.
- Tracking entries are purged automatically after the configured retention period.
- On uninstall, choose "Remove all app data" to delete the table, the email template and the configuration — or keep them to preserve history.

## Troubleshooting

### No emails are sent

- Check the scheduled task is running: `bin/console scheduled-task:list` must show `df_cart_recovery.process` as scheduled, and your messenger workers must be active.
- Test the shop's global email sending (Settings → Mailer): the plugin uses the standard mail service.
- Check the minimum cart value and the reminder 1 delay: a cart abandoned 20 minutes ago with a 60-minute delay is not yet eligible.

### Guests receive nothing

This is expected: without an email address, no reminder is possible. Guests are tracked as soon as they identify themselves (login or account creation during checkout) — the cart merge updates the entry with their address.

### The discount code does not appear in the email

- Check that "Include a unique discount code" is enabled and a promotion is selected.
- The promotion must exist, be active and have individual codes enabled.
- The code is only attached from the configured reminder onwards (the 2nd by default): reminder 1 carries none in the standard setup.

### The restore link redirects to the home page

The token is invalid or the entry was purged (retention exceeded) — the customer sees a message inviting them to rebuild their cart. Increase the retention period if your reminder delays are long.
