Skip to content

Abandoned Carts

The abandoned cart recovery feature helps you recover lost sales by automatically sending reminder emails to customers who add items to their cart but don't complete their purchase.

Overview

When enabled, the system:

  1. Tracks cart activity - Records cart contents when customers add items
  2. Detects abandonment - Identifies carts that remain unpurchased
  3. Sends email reminders - Automatically sends up to 3 reminder emails at configurable intervals
  4. Tracks recovery - Monitors click-through and recovery rates

Enable Abandoned Cart Tracking

Navigate to Ecommerce -> Settings -> Abandoned Carts in the admin panel.

Toggle Enable abandoned cart tracking to activate the feature.

WARNING

This feature requires a properly configured cronjob to work. Ensure your cronjob is set up before enabling. See Setup Cronjob for instructions.

Configuration Options

Email Reminders

When Send email reminders is enabled, the system sends up to 3 automated emails:

EmailDefault DelayPurpose
Email #11 hourFriendly reminder
Email #224 hoursFollow-up nudge
Email #372 hoursLast chance / urgency

You can configure:

  • Maximum reminder emails (1-3) - How many emails to send per abandoned cart
  • Email timing - Hours after abandonment for each email

Cleanup Settings

  • Cleanup old carts after - Days to keep abandoned cart records (default: 30 days)

Email Templates

The system includes 3 distinct email templates with different tones:

  1. Reminder #1 (Blue theme) - Friendly "Did you forget something?" message
  2. Reminder #2 (Yellow theme) - "Your items are waiting" follow-up
  3. Reminder #3 (Red theme) - "Last chance" urgency message

Customizing Email Templates

To customize the email templates:

  1. Go to Settings -> Email
  2. Find the Ecommerce section
  3. Look for templates starting with abandoned_cart_reminder_

Each template supports these variables:

VariableDescription
customer_nameCustomer's name or "Guest"
product_listHTML table of cart items
cart_totalFormatted total amount
cart_recover_urlLink to restore the cart
unsubscribe_urlOpt-out link

Cart Recovery Flow

When a customer clicks the recovery link in an email:

  1. Their previous cart is restored automatically
  2. They're redirected to the cart page
  3. A success message confirms restoration
  4. The click is tracked for analytics

Unsubscribe Handling

Each email includes an unsubscribe link. When clicked:

  • Customer is shown a confirmation page
  • No further abandoned cart emails are sent to that email address
  • Existing customers can also opt-out via account settings

Analytics & Statistics

The abandoned carts table shows key metrics:

  • Total abandoned carts - All tracked carts
  • Recovery rate - Percentage of carts that completed purchase
  • Click rate - Percentage of emails that received clicks
  • Revenue recovered - Total value of recovered orders

Cronjob Command

The abandoned cart system uses this command:

bash
php artisan cms:check-abandoned-carts

This command:

  • Checks for carts needing reminder emails
  • Sends emails according to the configured sequence
  • Respects opt-out preferences

To cleanup old carts:

bash
php artisan cms:check-abandoned-carts --cleanup

Or with custom retention days:

bash
php artisan cms:check-abandoned-carts --cleanup --cleanup-days=60

Cart Persistence Cleanup

A separate command handles expired persistent carts (guest and customer saved carts):

bash
php artisan cms:cleanup-expired-carts

Options:

OptionDefaultDescription
--guest-days=3030Days to keep guest carts
--customer-days=9090Days to keep customer carts
--stats-Show cart statistics without deleting

Example with custom retention:

bash
php artisan cms:cleanup-expired-carts --guest-days=14 --customer-days=60

To view cart statistics only:

bash
php artisan cms:cleanup-expired-carts --stats

Troubleshooting

Emails not being sent

  1. Check cronjob status - The settings page shows if cronjob is running
  2. Verify email configuration - Test email sending in Settings -> Email
  3. Check email templates - Ensure templates are enabled in email settings
  4. Review cart data - Carts need an email address to receive reminders

Cart not being tracked

  • Ensure Enable abandoned cart tracking is ON
  • Customer must add items to cart (empty carts aren't tracked)
  • Guest customers are tracked by session; logged-in customers by account
  • Links expire after 30 days
  • Already-recovered carts won't restore again
  • Products must still be in stock

Frequently Asked Questions

Does just adding to cart trigger tracking, or is checkout required?

Just adding to cart is enough. The system tracks cart activity immediately when customers:

  • Add items to cart
  • Update cart quantities
  • View the cart page

Customers do not need to start checkout for their cart to be tracked.

Why aren't customers receiving reminder emails?

The most common reason: the system doesn't have the customer's email address.

Customer TypeHow Email is Captured
Logged-in customersEmail captured automatically from their account
Guest visitorsEmail captured only when they enter it in a form (e.g., checkout)

If a guest adds items to cart but leaves before entering their email, no reminder can be sent - this is expected behavior, not a bug.

To test if the feature works:

  1. Log into a customer account on your store
  2. Add some items to cart
  3. Leave the site without buying
  4. Wait for the configured delay (default: 1 hour)
  5. Check your email (including spam/junk folder)

If you receive the reminder when logged in, the feature is working correctly.

What if cronjob shows "email sent" but nothing is received?

Check these in order:

  1. Email templates enabled? - Go to SettingsEmail → Ecommerce section → Enable "Abandoned Cart Reminder" templates
  2. Test email working? - Use "Send test email" button in email settings
  3. Email address captured? - Guest carts without email addresses cannot receive reminders
  4. Spam folder? - Ask customers to check spam/junk and whitelist your store email

Best Practices

  1. Set appropriate delays - Email #1 at 1 hour catches fresh abandonment; Email #3 at 72 hours creates urgency

  2. Keep templates concise - Focus on the cart contents and a clear call-to-action

  3. Monitor metrics - Track recovery rate to optimize timing and messaging

  4. Respect opt-outs - The unsubscribe system is automatic; don't manually re-add customers

  5. Clean up regularly - The cleanup command prevents database bloat from old records