Introducing the Commerce Abandoned Carts module

Drupal Version
7

Introducing the Commerce Abandoned Carts module

Users abandoned their shopping carts before completing the checkout process results potential lost sales. The Commerce Abandoned Carts module allows you to automate the sending of emails to users who have abandoned their carts, thereby allowing you to remind them of the incomplete checkout and/or provide additional information to them.

Installation:

Install and enable the module normally.

drush en commerce_abandoned_carts -y

Requirements:

When the module is first installed it is in TEST mode. While in TEST mode email will be sent to the configured test email address or the site email address if this empty. Also, while in test mode the database records are not updated so that the same test emails will be sent on each cron run.

Configuration:

Commerce Abandoned Carts module settings

To access the settings navigate to STORE→CONFIGURATION→COMMERCE ABANDONED CARTS (admin/commerce/config/abandonded_carts)

  • Send Timeout: This is the amount of time to wait before a cart is considered abandoned (in minutes). For example, the default setting of 1440 minutes will wait one day from the time a cart is first created before sending the message.
  • History Timeout: This setting is used to prevent the module from sending messages to users who have created their cart too long ago. The default setting of 21600 minutes will prevent the messages from being set for carts that are more than 15 days old.
  • Abandoned Statuses: Check all of the cart/order statuses to be considered not completed. When the module runs it will query for carts/orders that meet the above setting requirements, ere one of these checked statuses and the user has entered an email address.
  • Batch Limit: This limits the amount of emails that will be sent per cron run. A higher number will user more resources per cron run. If you set this to a lower number for efficiency then you should set your cron to run multiple times per day if you want to process for abandoned carts.
  • From Email Address: This is the email address that the abandoned cart messages will be sent from. Leave blank to use the site email address.
  • From Email Name: This is the name that will be shown as the abandoned cart messages will be sent as. Leave blank to use the site name.
  • Email Subject: This is the subject line that will be displayed on the abandoned cart messages.
  • Customer Service Phone Number: Optional phone number to be included in the phone number variable to be used in the email template. Leave blank to omit.
  • Enable Test Mode: Check the test mode box the enable test mode. While in test mode all abandoned cart messages will be sent to the test email address entered, or to the site email address if left blank. No database updates will be made while in test mode, this means that the same emails will be sent during each cron run while in test mode. Once test mode is disabled then emails will be sent to the user/customer email and the database will updated to only send one email per cart/order.

Notes:

Email can only be sent if the user has entered their email address during the checkout process. Obviously, we can't send an email to a user if we don't have their email address.

Proper cron setup is required.See the cron notes below.

Cron:

Proper setup of your site's cron system is required for proper functionality. We recommenced not using Drupal's built in "poor man's cron" but rather setting up a cron task on your host/server.

When setting up your cron task it should run at least as often as your "send timeout" setting or your messages will not send as often as you'd like.

More information about setting up cron on Drupal.

Email Template:

The email message sent to users can be easily customized by copying the files from the module's theme directory into your default theme directory. Then clear the site's caches and customize the template as needed.

NOTE: See the template file for further information and available variables. You can also override the commerce_abandoned_carts_theme() function to further customize if needed.

Author Information

Written by: Shawn Ostermann

Shawn is a Drupal Specialists with over 12 years of experiencing building and developing Drupal websites including custom module development and e-commerce websites.