Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] - Customer Loyalty Discount Scheme


64sp

Recommended Posts

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.

***************************************

I've been contemplating thinking about thinking

***************************************

Link to comment
Share on other sites

Does it allow the option of not calculating if there are other discounts applied, via gift certificate, or coupon?

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

It looks to see if gift vouchers are in the current order and deducts them from the order total before applying the discount, so that you do not give a discount against the gift vouchers being bought.

 

Also it does not compound the discount on top of a previous discount, i.e if a previous discount is applied (say an order value discount) it calculates its own discount on the already discounted amount. Which discount gets applied first depends upon the sort order you set in the admin/order total section. For example order for ?100 less 10% order value discount gives ?90 less the customer loyalty discount of 10% gives ?81. (10% x ?90).

 

But to answer your question, it does not "turn off" the loyalty discount if another (or indeed several other) discounts have already been applied to that order.

Having said that, I only have customer specific discount and order value discount modules loaded on my test shop. I will load up the gv and discount coupon module and test with that before I comment further.

***************************************

I've been contemplating thinking about thinking

***************************************

Link to comment
Share on other sites

I was thinking it should only let you use one discount or another, which ever has the greatest value, but not both.

 

I understand its not easy to create contributions that are compatible with other contributions (I ahve a few myself), but I think that the GV/DC are becoming more and more integrated.

 

That being said, I think that this is a fantastic contribution, and would love to implement it myself.

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

Agreed, this is something that many folks have discussed and since I am not a coder, I can't help develop it. I am glad it is being worked on.

[no external urls in signatures please, kthanks]

Link to comment
Share on other sites

I agree it is a good point. It is unlikely that you would want to grant a customer more than one discount at a time.

 

The problem of course is that each discount module is written as a stand-alone plug in module and can't (if it is intended to work off the shelf on any install) reference other installed discount modules or indeed discount modules yet to be written or installed.

 

At the moment the answer would be to only install one or other of the discount modules at a time depending on what effect you are after. The gv and discount class (by Ian C Wilson) is definetely a step in the right direction because it helps you implement different discount plans within the same class.

 

Having said all this I will look at writing a "drop-in script" that could be used in addition to the module if required by those with multiple discount modules, to dynamically choose which discount to apply to a given customer order, either giving the highest/lowest/average of the discounts or applying them in a pre-defined order.

***************************************

I've been contemplating thinking about thinking

***************************************

Link to comment
Share on other sites

  • 2 weeks later...

Hi Simon!

 

I have the same problem with "Customer specific discount percentage" and "GV". "Customer specific discount percentage" should only work for normal products, but not for Gift Coupons. Do you have an idea how to fix this? Maybe it helps, that all products have a weight more then 0.1. Gift Coupons weight is 0.

 

Helmut

Link to comment
Share on other sites

rixride

 

I have been thinking about a similar thing myself.....whether you could add a free product to their basket if they have spent over a certain amount....in your case a GV "product" but in other cases maybe a free promotional or free gift product.

 

I'll have a think and post shortly.

***************************************

I've been contemplating thinking about thinking

***************************************

Link to comment
Share on other sites

Helmut

 

Did you make sure that your gift voucher product was set up with a product model starting with GIFT ?

 

Because the GIFT string is what the discount modules look for in the shopping cart when deciding which products to apply the discount to (or not to in the case of the GV's !)

***************************************

I've been contemplating thinking about thinking

***************************************

Link to comment
Share on other sites

Hi Simon!

 

I?m absolutly sure.

 

BTW I searched all files of "Customer_discount_V1.1a.zip" for the string GIFT but got no results. Is Customer_discount_V1.1a.zip an old version?

 

If not, could you post here the code that contains the "look for string GIFT in product model ... ... ..."?

 

Thank you,

 

Helmut

Link to comment
Share on other sites

Hi Simon

 

I have been desperately seeking a way to incorporate a rewards points system and have just come across your topic here.

 

Is there any way your contribution can be modified to cumulate total orders rolling over a period of time and place the equivalemnt number of points in either the coupon or gift voucher or indeed a seperate points account.

 

The points or accumulated vouchers could be redeemed for gifts from a gift category in the store. Of course, I agree only one discount system should be used and so the 'gift vouchers' or coupons could be renamed as 'Rewards points'.

 

Any help or advice would be appreciated

 

Best Regards

 

Maz

Link to comment
Share on other sites

Hi Maz

 

This module is not really suitable to be adapted for what you are looking for in a rewards points system. Although of course the logic I have used for tracking total prior sales value could be re-used in such a new module. I am afraid I dont have time myself to write a rewards module at the moment but it would be worth posting a new topic and see if anyone else can help.

 

Sorry if I am stating the obvious but have you thoroughly searched all the contributions sections because I have a recollection of seeing a point system somewhere.

 

Good luck

Simon

***************************************

I've been contemplating thinking about thinking

***************************************

Link to comment
Share on other sites

Helmut

 

If you look in includes/modules/order_total/ot_loyalty_discount.php around line 85 as part of the get_order_total function you will see the code.

 

But I think you are talking about the customer specific discount module which I didnt write rather than this (my) customer loyalty discount module.

 

If you compare the code particularly in the get_order_total function in your ot_customer_discount.php with the code in my ot_loyalty_discount.php you should be able see how it is done.

 

I hope this helps.

 

PS - Just for clarity the pieces of code in question which filter out the ^GIFT products before applying the discount were written by Ian Wilson not me !

 

PPS - Gift vouchers should have a product model staring ^GIFT rather than GIFT as I wrongly said before !!

***************************************

I've been contemplating thinking about thinking

***************************************

Link to comment
Share on other sites

Helmut

PPS - Gift vouchers should have a product model staring ^GIFT rather than GIFT as I wrongly said before !!

 

If it's a regexp (I havent looked at the code yet) the ^ means "start of the line" and in that case it would match any string that began with "GIFT".

Link to comment
Share on other sites

Helmut

 

If you look in includes/modules/order_total/ot_loyalty_discount.php around line 85 as part of the get_order_total function you will see the code.

 

But I think you are talking about the customer specific discount module which I didnt write rather than this (my) customer loyalty discount module.

 

If you compare the code particularly in the get_order_total function in your ot_customer_discount.php with the code in my ot_loyalty_discount.php you should be able see how it is done.

 

I hope this helps.

 

Hi Simon!

 

This helps!

 

You are right - I?m using customer specific discount module.

 

Replacing function get_order_total() (customer specific discount module)with your function get_order_total() makes that the discount does not affect GIFTs.

 

Thank you,

 

Helmut

Link to comment
Share on other sites

We?re having difficulties getting the customer loyalty script to work. It?s not giving any errors, but it?s not working either.  

 

We see and have activated all variables via the admin interface, but when purchasing two products in a row in different sessions there is no discount displayed. Could you help us out?

 

This was sent to me via email. My answer follows.

***************************************

I've been contemplating thinking about thinking

***************************************

Link to comment
Share on other sites

Have you made sure that the threshold for the first level of discount is low enough for your cumulative order value to invoke a discount ?

For example, the default setup when you install the module is for a discount of 5% on the order when the customer has spent ?1,000 or more in the past year.

Have you made sure that your test customer account has exceeded this amount in the last year or that you reduce the period and discount level appropriately so that the test customer reaches the discount point. Otherwise no discount will show on an order.

***************************************

I've been contemplating thinking about thinking

***************************************

Link to comment
Share on other sites

I downloaded the contribution and uploaded the 2 files to their correct folders as indicated in the txt file.

 

However, nothing extra appears in my admin, where as it should make an extra option available in the orders total module.

 

Do i miss an extra page here which was not in the zipfile or is there an error in the description?

 

What are the options ???

Link to comment
Share on other sites

There are just the 2 files to be uploaded (txt file also included in package).

 

1 should go in yoursite/includes/modules/order_total/

1 should go in yoursite/includes/languages/english/modules/order_total/

 

and as long as you have your osc admin configured to look at the correct folder for the order total modules (if you didnt you wouldn't see any order total modules at all in admin) then it should show as "Customer Loyalty Discount".

 

Sorry but I can only suggest re-checking your file locations again and make sure that they have been uploaded properly.

 

In the meantime I will check that my txt file explains correctly.

***************************************

I've been contemplating thinking about thinking

***************************************

Link to comment
Share on other sites

Hi T-runks

 

Neither module will interfere with each other in the sense that they work independantly and can safely run side by side.

 

However, if you read through the first couple of pages of this thread you will see there is a "problem" with using more than one discount module at a time in that (in summary):

 

BOTH modules will apply a discount and will not (cannot ?) talk to each other and decide for example to only apply the highest of the 2 discounts.

 

According to the sort order you set in your admin under order total modules, the first discount module will apply its discount on the sub-total of the order (altering it for tax and/or shipping depending upon your admin settings), the second discount module will then take the already discounted amount and apply its own discount to that.

 

So, although you dont compound the discount, you do end up with 2 discounts being applied which you may not want.

 

Hope this helps.

***************************************

I've been contemplating thinking about thinking

***************************************

Link to comment
Share on other sites

Oke thanks, the 2 discounts won't be a problem for me then, since they are only applied to very special persons which are all personal friends of mine, so i can do a manual update if needed and they will know whats going on, so i just have one thing to add to your contribution and that is that it is exactly what we where looking for so big up yourselve :-) for the great job !

 

Thanks again

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...