Abandoned Carts Recovery

Recover abandoned Commerce carts, and increase sales!

Craft 3 status: I'm currently focusing on upgrading my plugins to Craft 3. The Craft 2 version of this plugin is feature frozen. Contact me if you need anything custom for Craft 2.

Installation #

To install Abandoned Carts, follow these steps:

  1. Download & unzip the file and place the abandonedcarts directory into your craft/plugins directory
  2. Install plugin in the Craft Control Panel under Settings > Plugins
  3. The plugin folder should be named abandonedcarts for Craft to see it.

Abandoned Carts works on Craft 2.5.x. and higher.

Abandoned Carts Overview #

Work in progress

Configuring Abandoned Carts #

You can configure everything through the plugin settings.

It's also possible to override the settings with a config file. There is an example included in abandonedcarts.php.

<?php
return [
    // Supports
    // 1 hour later (recommended).
    // 6 hours later.
    // 10 hours later (recommended).
    // 24 hours later.
    // 36 hours later.
    // 48 hours later.
    // 72 hours later.
    // 96 hours later.
    'interval'               => 1,

    // How far back the plugin will look for abandoned carts
    // In hours
    'maxPastInterval'        => 7 * 24,

    // Where to redirect customer when clicking link in e-mail
    'restoreRedirectUrl'     => '',

    // When someone unsubscribes, they will be redirected here
    'unsubscribeRedirectUrl' => '',

    // Email settings
    'fromName'               => '',
    'fromEmail'              => '',
    'subject'                => '',

    // HTML template
    'template'               => '',

    // Text template
    'templateText'           => '',

    // If you set this, all recovery emails will be sent to that address
    // 'testEmailAddress' => '',

    // If you want a coupon to be applied automatically, use this
    'couponCode'             => '',
];

Using Abandoned Carts #

You need to setup a cron job that either calls the check URL or the console command. Both methods are listed in the settings screen. Recommended interval is 5-10 minutes.

The check will first find any suitable abandoned cart according to the ruleset, and it will then create and run a task. If you have any stalled or long-running tasks in the queue, this might cause problems.

On the plus side, tasks makes it easier to notice if e-mail sending fails.

Qualifying carts #

Abandoned Carts tries it best to qualify if a cart/customer should get an e-mail. The ruleset is modeled on Shopify's research.

The ruleset checks the following:

  • If there is an valid email set on the cart
  • If a customer has unsubscribed from receiving abandoned cart emails before
  • If a order has any items
  • If a customer has ordered within the last 24 hours
  • If any transactions on the order has failed
  • If the total price is above 0
  • If at least 1 item in the cart is available for delivery

TODO: Add a more detailed table of the rules, and how they are checked

Email template #

Example HTML and text templates is included in the folder example-email. The templates is passed order (Commerce_OrderModel) and recovery (AbandonedCartsModel).

Abandoned Carts Roadmap #

  • Better documentation
  • Add top abandoned products
  • Detect multiple abandoned carts for email within the interval, and only send e-mail for latest
  • Detect if a order isn't possible to ship to the defined customer
  • Add analytics widget

Frequently asked questions

How many sites can I install the plugin on under 1 license?

It's pretty simple: 1 license covers 1 site / Craft installation.

I'm having an issue with emails not being delivered

You should use a email service provider like Postmark, Mailgun, Amazon SES, Mailjet or similar. They will ensure deliverability is top notch, and they will give you detailed logging, which should make it easier to track down issues.

How can I test this locally without sending out emails?

I recommend using MailDev, a really neat utility that will log all outgoing emails in a nice inbox. Contact me if you need help with the right email settings in Craft.

Releases

1.2.1 — 2018-07-09
  • Added: Added content entry to email steps
1.2.0 — 2018-07-09
  • Added: Added multiple email steps
  • Fixed: Fixed data range for analytics
1.1.1 — 2018-01-30
  • Fixed: Fixed error in unsubscribe section
  • Fixed: Fixed error in license section
  • Improved: Misc code changes to make it easier to work with the plugin
1.1.0 — 2017-11-09
  • Added: Added note about test email address being set.
  • Added: Added plugin permissions. You may now limit who can do what.
  • Added: Added maxPastInterval setting. This will limit how far back in time the plugin checks for abandoned carts. By default it's set to 7 * 24 hours / 1 week.
1.0.9 — 2017-07-31
  • Fixed: Added missing parameters to log call
1.0.8 — 2017-07-12
  • Fixed: Fixed column type for HTML/text email content that caused the email preview result to be trunctated (again)
1.0.7 — 2017-07-11
  • Fixed: Fixed PHP error that would be triggered if there was no mailable carts waiting and you triggered the check action
  • Fixed: Fixed column type for HTML/text email content that caused the email preview result to be trunctated
  • Fixed: Fixed PHP error when cart element records have no email set
  • Fixed: Email preview is now using it's own template rendering method to avoid CP JS/CSS being included
  • Fixed: Fixed MySQL issue when manually recovering orders
  • Improved: Added error logging to email records (for the future).
1.0.6 — 2017-07-07
  • Fixed: Remove duplicate text template field
1.0.5 — 2017-07-03
  • Fixed: Fixed release feed url
  • Improved: Now possible to download update directly from update screen if install has valid license
1.0.4 — 2017-07-03
  • Fixed: Migrated to custom license checking. This should fix the problem with "Invalid license" prompts some sites was experiencing.
  • Improved: Text templates will not be HTML escaped any more.
  • Improved: Added longer check intervals.
1.0.3 — 2017-06-16
  • Added: Added text email example
  • Improved: Config model now only tries to check for config overrides for if it has a matching attribute
1.0.2 — 2017-06-14
  • Added: Added test mode
  • Added: Added recovery view
  • Added: Test email address setting. If this is set, all emails will be sent to this address.
  • Added: Added list of unsubscribes
  • Improved: Cleaned up settings a bit
  • Fixed: Fixed open tracking when clicking, if no opens has been registered
1.0.1 — 2017-06-12
  • Added: Refactored recovery saving and email sending through the console command to run 1 process per order. This should prevent larger stores hitting the memory limit
  • Added: Option to use console command when calling the controller with a HTTP call
  • Improved: Now qualification result is saved to the recovery record
  • Improved: Update recovery if order total is changed, or email is changed AND no recovery email has been sent
1.0.0 — 2017-06-07
  • Added: Initial beta release

Currently available for Craft consulting and custom plugin development

Contact me