Customer Loyalty Discount Scheme Module.
The purpose of this order total module is to provide a basic Customer Loyalty Program/Discount Scheme, that rewards customers with discounts against each order based upon the
amount they have spent in prior periods.
This module, at the time of a customer order being placed, totals up the value of all previous orders this customer has placed
over a pre-defined (in admin) rolling period of time and then applies a discount rate to this order according to a table of discount rates also
pre-defined (in admin) that correspond to the amount spent over the rolling period.
For example, in admin you have set the pre-defined rolling period to a month, and set up a table of discounts that gives 5.0% discount if they have spent over £1000
in the previous month (i.e previous 31 days, not calendar month), or 7.5% if they have spent over £1500 in the previous month.
Legend: 
Download

Report
I have added a temporary fix for all that have installed SPPC as well (the new SPPC version 4.2.1 should have this included already).
This will disable the Loyalty Discount Module for all customer groups but group 0 (Retail by default).
NOTE:
Please use one of the below versions if you do not have SPPC installed as this code might otherwise not work.
When you have purchase without account module installed this would give them a discount even if they have never bought from you as everyone who uses purchase without account module gets an id of 0.
This fixes it.
FULL PACKAGE
This version of the Discount status display in the members account page works. I have updated the install.txt and added two images to be uploaded.
MAKE SURE TO BACKUP BEOFRE DOING!
One note: If you have CCGV or Discount coupons installed, this will work with that, however the discount will be applied to the subtotal after any other discounts are removed.
I'm not a coder so I don't know of any way around it. It works for me, but may not be what you want.
FULL PACKAGE
- Added discount status is the user account page.
THIS NOT THE FULL PACKAGE: THIS ONLY DANISH LANGUAGE PACK
Danish language pack has been add.
Move the "ot_loyalty_discount" into /catalog/include/language/danish
This mod will print the customer's discount level on account.php, but can be placed on any page by adding the provided code.
I found a small bug that was causing the Parse error.
on line 19:
I changed
$this->code = 'ot_loyalty_discount';
to:
$this->code = ot_loyalty_discount;
(removed the quotes around ot_loyalty_discount)
and that should fix it! Works for me
You can download the last fix here (same as posting of 5 Aug 2004 - Fix to rectify the rounding off error with figures is the corrct one.)
Please go to http://forums.oscommerce.com/index.php?showtopic=121516 for more advice if you have a problem........
Two Screenshots also included.
I have changed the file ot_loyalty_discount.php to make sure that this rounding off error of amounts is rectified. I have now also added a fix to correctly calculate the discount amount.
Otherwise everything the same as below !!
I have added a few lines to the file ot_loyalty_discount.php to make sure that this rounding off error of amounts is rectified. The amount of discount is immediately rounded off to two figures after the comma, before it is used.
README included
********************************************************************************
P.S. Also includes: (i) my translation in dutch and german
(ii) Clement Nicolaescu (STATUS) option
********************************************************************************
Note: This is all fictional. The products purchased will not be delivered nor will the customer be billed.
You have to place an order first that exceeds € 100 (or whatever currency you prefer) and then you can order something. After that you get a certain discount (%) on the subtotal. Please keep in mind the tax-deduction when the discount is calculated! I have also set the status on 1 (in a real shop this is not done!) - so that the result is seen by you immediately.
TIP: For the try-out you can use --> Choose Cash on Delivery for a Payment Method to Continue with the buying procedure
Enjoy it!
My need was to not calculate the undelivered or cancelled orders in the total amount spent by the customer in the given period.
So, I added a new option named Order Status so the admin can decide the minimum status for orders in the total spent calculation.
Ex. If a customer has 2 orders - one for $100 being delivered (status 3) and one for $200 being peding (status 1) and the loyalty scheme has Order Status option to 3 then the total amount spend will be just $100.
I use this brilliant contribution to reward my resallers based on their performance at www.osCoders.biz
This is a dutch and german translation for this amazing piece of work by simon.
please check the german bit i am not an ace on german. no code was changed only translated.
reg,
Rob Jörg.
Customer Loyalty Discount Scheme Module.
The purpose of this order total module is to provide a basic Customer Loyalty Program/Discount Scheme, that rewards customers with discounts against each order based upon the
amount they have spent in prior periods.
This module, at the time of a customer order being placed, totals up the value of all previous orders this customer has placed
over a pre-defined (in admin) rolling period of time and then applies a discount rate to this order according to a table of discount rates also
pre-defined (in admin) that correspond to the amount spent over the rolling period.
For example, in admin you have set the pre-defined rolling period to a month, and set up a table of discounts that gives 5.0% discount if they have spent over £1000
in the previous month (i.e previous 31 days, not calendar month), or 7.5% if they have spent over £1500 in the previous month.