# Basket Recovery Plugin

## Introduction
The BasketRecovery module allows administrators to manage emails to be automatically sent out in the occasion that a customer does not complete their purchase.

The most basic form of this is to send an email at the specified interval, however there are more features available (turned on/off in settings):

* Send a coupon with the email.
* View stats on the performance of a coupon (Reads, Clicks, Sales)

## Installation
Most of the installation is automated. To install, simply load this module into the folder /modules/BasketRecovery/ and then visit the admin page for this module.

This will automatically build the necessary tables, settings, and admin menu item.

The only actions needed is to set up a new cron job to /scheduled/run.php to run every minute.

### Running on older ecommerce sites

Rihards has ported this to pre-core ecommerce sites on Maharishi

### Dummy Data
If you are requiring to also create dummy data, you can comment out the bottom lines in /includes/install.php which generates several rows of fake data.

### Coupons
As this generates coupons automatically, you may wish to alter the coupon admin area to ignore any coupons with a code staring with BASKET_RECOVERY_COUPON_PREFIX (default: BR)

## Settings
There are multiple constants defined within the settings file to control this module:

* BASKET_RECOVERY - Turn on/off this module
* BASKET_RECOVERY_STATS - Turn on/off stats displayed in admin area
* BASKET_RECOVERY_COUPON - Turn on/off ability to create coupons with recovery emails
* BASKET_RECOVERY_COUPON_PREFIX - Give each coupon generated a custom prefix (default: BR)
* BASKET_RECOVERY_COUPON_EXPIRY - The default interval for any coupons generated, for use with DateInterval (default P1M)