CartThrob Expired Cart Notifications Version 1.03

CartThrob Expired/Abandoned Cart Notifications addon enables your CartThrob enabled website to send email notifications when your customer has abandoned their cart. Studies have proven that follow up emails for abandoned carts is a highly effective method of completing a sale, as well as increasing the per-sale transaction amount by sending special offers with these notifications. This addon makes it simple to create a multie-tiered notification system for customers that have abandoned their carts.

CartThrob Expired Cart Notifications is an addon for CartThrob. Like other CartThrob addons, it must be uploaded and installed on your website, and CartThrob must be active for it to run. To use this addon you will need to create notification templates. The content of these templates will be emailed to customers if their cart has been abandoned.

Features

  • Create tiered notifications, with emails sent from a few minutes up to weeks after the customer's cart has been abandoned.
  • Specify multiple email templates for early notifications, and additional generic emails for ongoing reminders of an abandoned cart
  • Uses standard EE templates system to store notification templates.
  • Set limit on how many additional follow-up emails the customer should get.

Requirements

  • ExpressionEngine 2.5+
  • CartThrob 2.3+
  • PHP 5.3+

Installation

  • Upload the /system/expressionengine/third_party/cartthrob_expired_cart_notifications/ folder to /system/expressionengine/third_party/
  • Make sure Extensions are enabled on your system
  • Install the CartThrob Expired Cart Notifications module and extension (through EE's add-ons/modules panel)
  • Create notification templates using EE's template system
  • Go to the addons » modules » CartThrob Expired Cart Notifications settings and configure one or more notifications

Upgrading

  • Upload the /system/expressionengine/third_party/cartthrob_expired_cart_notifications/ folder to /system/expressionengine/third_party/ Overwriting existing files.
  • Go to EE settings » addons » and click "Run Module Updates"

Settings

These settings are primarily notifications settings, which are covered in more detail below

One particular setting to pay attention to is the "Notification Debug" setting

If this is set to "yes" abandoned carts will not be marked as checked, so you can continue testing over and over on the same abandoned carts. In any case, you will need to allow some time to pass between when carts are created for testing and when you begin testing the notifications sent from this module. Enabling this setting just means that the same cart data can be used over and over during testing. It's also important to note that CartThrob itself deletes carts over time if they've been abandoned. If these carts are not deleted, you will end up with quite a bit of needless entries in your database. Generally speaking it's best to set up your abandoned notifications to be active within the first 24 hours. Beyond that time frame, you'll find customers getting annoyed with your follow ups.

CartThrob Expired Cart Notifications Settings CartThrob Expired Cart Notifications Settings.

CRON

This addon requires that your system be told to periodically check for expired carts. To this end, there is a CRON url listed in the CartThrob Expired Cart Notifications settings. You can either manually visit this URL check for expired carts or ideally you should automate the process by using CRON. CRON is a time based scheduling application already available on most hosting platforms. CRON can be configured to call a URL on your website that checks for expired carts. Setup of CRON is fairly simple. Most hosts provide an administrative interface for CRON, or you can generally provide our CRON command to the host's support and they will add it for you. Once cron is set up once, you need take no further action with it in the future.

Note You must either use CRON to ping the expired notifications URL, or you must visit the CRON url (listed in the settings for this addon) on a regular basis using your web browser.

The following are sample scripts you can use with CRON. Generally, you will need to either contact your hosting company to add those commands, or using your hosting control panel, you will need to set up a CRON job using those commands. Essentially, once you've figured out where you can add CRON jobs, you just need to copy the command from the subscriptions settings page, paste it, and save the CRON job.

Note We do not provide free support for CRON configuration. If you need assistance setting up CRON, please contact us, and we can assist you in setting it up at our standard hourly rate.

NOTE: Our CRON methods make use of a file called extload.php in themes/third_party/cartthrob/lib. If you have changed the location of your system folder, you will need to update extload.php with the location of your system folder.

There are several methods available on most systems to run CRON.

  1. If you can execute shell scripts on your server:

    /your/server/path/to/themes/third_party/cartthrob_expired_cart_notifications/lib/cron.sh /server/path/themes/third_party/cartthrob/lib/extload.php

  2. If you can run perl scripts on your server:

    /your/server/path/to/themes/third_party/cartthrob_expired_cart_notifications/lib/cron.pl /server/path/themes/third_party/cartthrob/lib/extload.php

  3. If your server allows the use of PHP's "passthru" function: /your/server/path/to/themes/third_party/cartthrob/lib/extload.php cartthrob_expired_cart_notifications get_expired_carts

  4. You can also manually call your rebill URL manually. (the URL is listed in your settings page)

  5. Or it can be called via CURL curl --silent "your url" 2>&1 /dev/null

It may be easiest, if you are unfamiliar with CRON to contact your hosting company and ask them the best way to set up CRON, or request that they set it up for you. Using the provided scripts, it should be fairly straightforward to add.

Expired Cart Notifications Settings Expired Cart Notifications Settings.

Notifications

Unlike many CartThrob addons, this one has its own notifications manager where you can create and edit notifications. Like other CartThrob addons, it also uses ExpressionEngine's template system to store template data. You create notifications using EE's standard template system, and then select these templates in CartThrob Expired Cart Notification templates. You can set multiple different templates that will be sent at different times after the cart has been abandoned. A common usage would be:

  1. to set one template 2 hours after abandonment
  2. one day after abandonment
  3. two days after abandonment
  4. one week after abandonment
  5. additional follow up emails weekly or monthly

There are two types of notifications

  1. Initial notifications
  2. Additional regular notifications

Initial notifications are intended to be immediate follow ups for abandoned carts. These should be unique notifications, often including a special offer for returning customers

Additional regular notifications are intended to be more long-term follow ups, and really only intended for sites that require membership to purchase items. This is ideal for private carts set up for vendors or distributors, or other private shopping systems where additional regular notifications will be welcomed by the receiver rather than treated as aggressive spam by annoyed customers.

If you are going to send very many abandoned cart notifications, or use the Additional Regular Notifications, it's best to require that your customers are always logged in before they're allowed to add their email address to the cart. CartThrob tracks carts to specific members, and if they log in the last cart they were working with will be relaunched. For guests however, it may not be possible to track a specific cart ID to their purchase if they return to the site, in which case it's best to only send one follow up email. Whenever any specific cart is part of a completed transaction, no additional notifications will be sent for the owner of that cart.

The additional regular notifications includes settings for the number of times a customer should be recontacted, and how often.

Variables

You can use the following variables in your templates.

{first_name}
{last_name}
{address}
{address2}
{city}
{state}
{zip}
{country_code}
{company}

{language}
{currency_code}
{email_address}
{phone}

{shipping_address}
{shipping_address2}
{shipping_city}
{shipping_country_code}
{shipping_first_name}
{shipping_last_name}
{shipping_state}
{shipping_zip}
{shipping_company}

{shipping_option}

{total}              // numeric
{discount}           // numeric
{taxable_discount}   // numeric
{tax}                // numeric
{subtotal}           // numeric
{taxable_subtotal}   // numeric
{shipping}           // numeric
{shippable_subtotal} // numeric

{items}
    // use in combination with a channel entries tag 
    // to output additional information about this product
    {entry_id} 
    {quantity}
    {url_title}
    // outputs a very high number if the item has 
    // "unlimited" inventory or untracked inventory
    {inventory} 
    // Only outputs if the item has a manually set title.
    {title} 
    // Only outputs if the item has a manually set price. 
    {price} 
{/items}

// this is the last URL the user visited 
// (as tracked by ExpressionEngine). It's possible that it 
// may be set as a Javascript or CSS file or any other EE page.
// The last page rendered by EE is saved as the URL, 
// as such this variable may have limited use. 
{url} 

Plus you can use all of the cart_info variables which include the proper monetary number formatting

{total_items}
{total_unique_items}
{cart_entry_ids}
{cart_shipping}
{cart_tax_rate}
{cart_tax}
{cart_subtotal}
{cart_total}
NOTE Even though this addon has its own notifications, it also registers notifications with CartThrob as well. If you'd like to send additional notifications (for example to send a notification to a store employee or outside vendor) you can set up notifications to people other than the customer using CT's standard notifications system. These notifications will only be sent as part of the "Additional regular notifications".

Testing Procedures

The simplest way to test whether or not your notifications are working correctly is to simulate the whole cart expiration and notification process. Do the following:

  1. Create at least 1 notification
  2. Set the time that these notifications should be sent to 1 minute
  3. Set the debugging setting to "yes"
  4. Create a notification template with something simple written in it like "test!"
  5. Add some items to your cart while you are logged in.
  6. Wait several minutes
  7. Load the CRON Notification URL (listed on your settings page toward the bottom) in your browser (nothing will output in this screen)

Once you have loaded that notification URL, the system will send appropriate notifications to the email address associated with the account you were using while adding products to your cart. Feel free to reload this URL multiple times and multiple notifications will be sent. While in debug mode, contact counts will not be updated, so the same email will be sent multiple times.

Change Log

WARNING If your install of this addon includes a file called: libraries/Mbr_addon_builder.php please delete it. CartThrob versions after 2.3.3 include the latest version of this file. If it is not deleted, it can cause problems in the use of this addon.

V1.07

  • Fixed issue where settings would not save
  • Fixed an issue where adding a new notification would add two notifications with limited ability to save both or remove one.
  • Added additional item & totals variables that can be sent in notifications
  • Fixed an issue where the debug setting was being ignored