Jump to content



Photo
- - - - -

Building a Store Credit System


  • Please log in to reply
52 replies to this topic

#21   burt

burt

    I drink and I know things

  • Community Team
  • 12,438 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted 15 May 2015 - 18:37

With some advice from @wHiTeHaT I've gotten this finished with no core code changes other than the necessary core code change in admin/customers.php

 

Will post more about what was done after the weekend.


This is a signature that appears on all my posts.  It is not specifically aimed at you.

 

IF YOU MAKE A POST REQUESTING HELP...please state the exact version of osCommerce that you are using. THANKS
 
If you are still on the old style osCommerce, it is time to move to Responsive.

 


#22   BrockleyJohn

BrockleyJohn
  • Community Sponsor
  • 464 posts
  • Real Name:John Ferguson
  • Gender:Male
  • Location:sarf Landin

Posted 15 May 2015 - 19:21

Did you allow for multi-currency stores?


BS Edge for PHP7 - here on github: https://github.com/B...i/PHP-7-changes

Bootstrap addons - one per branch on github: https://github.com/B...iew-of-Branches

 

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later integration at 2.3.x


#23   clustersolutions

clustersolutions
  • Community Sponsor
  • 450 posts
  • Real Name:Tim
  • Gender:Male
  • Location:Los Angeles

Posted 15 May 2015 - 20:50

Ah...no one is gonna like this solutions...but I used a CCVG version 5.8 hack. Yes, massive core codes change...I don't use the gift card feature, but I use its mail gift voucher and gift voucher sent as a way to manager store credit...now, something else to think about...if you are offering free shipping...do you want to offer it when customers are using store credit? Our avg shipping cost is $12 and sometimes up to $16USD so we couldn't offer free shipping when store credit was being applied...so another painful hack was necessary...but the store credit works for years now...CCVG is a good start but a lot more clean up work is needed...

 

in the pics customer can see her credit after login...

 

 

 

 

Attached Files



#24   chilinotes

chilinotes
  • Members
  • 31 posts
  • Real Name:Oliver
  • Gender:Male
  • Location:Frankfurt / Main, Germany

Posted 15 May 2015 - 21:57

Just a thought...

 

To avoid misunderstandings the customer should get a statement of account as pdf send by email after purchase.

Plus an extra copy send to the shopower. This may simplify the work, all is in the files.


Edited by chilinotes, 15 May 2015 - 22:00.

Sometimes systems that should not work, work nevertheless.


#25   clustersolutions

clustersolutions
  • Community Sponsor
  • 450 posts
  • Real Name:Tim
  • Gender:Male
  • Location:Los Angeles

Posted 15 May 2015 - 23:03

Oh, also...CCVG's gift voucher sent page can give a good audit trail on credit issued...especially important if you have employees...using the admin login id we can track who issued the credit and who redeemed it...no chance for embezzlement...we also setup a store credit liability account to keep track of things...

Attached Files



#26   burt

burt

    I drink and I know things

  • Community Team
  • 12,438 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted 16 May 2015 - 08:48

@clustersolutions what happens if the credit balance covers the full cost of the order, therefore bringing the total cost to zero.


This is a signature that appears on all my posts.  It is not specifically aimed at you.

 

IF YOU MAKE A POST REQUESTING HELP...please state the exact version of osCommerce that you are using. THANKS
 
If you are still on the old style osCommerce, it is time to move to Responsive.

 


#27   clustersolutions

clustersolutions
  • Community Sponsor
  • 450 posts
  • Real Name:Tim
  • Gender:Male
  • Location:Los Angeles

Posted 16 May 2015 - 22:15

@burt...this post covers your question...

 

http://forums.oscomm...help/?p=1726370

 

Basically, hide/remove etc. the payment module at confirmation, and at checkout_process unset the $payment and any requirements to have an actual payment. Also, some logic is needed to set the payment method to store credit. The checkout pages were heavily hacked...

 

Currently, the CCGV is frankenOOP and a lot of the properties are set in the global session variables...for sure, a redesign CCGV and shipping using OOP would be a lot better in handle issue that I was discussing above to eliminate chicken and egg problem from a procedural point of view...well, I have a finished thesis but not a good one...



#28   MrPhil

MrPhil
  • Members
  • 6,972 posts
  • Real Name:Phil
  • Gender:Male

Posted 17 May 2015 - 12:56

Could there be instances where a store credit would cover the entire payment due, but a customer might reasonably not want to apply the full credit at this time (just part of it)? Automatically applying the full credit might also leave a tiny balance due that isn't worth charging a credit card for, so the customer might want the option of applying just part of the credit.

 

Also be aware that many legal jurisdictions may require that you pay interest on customer credit balances, so you may need a mechanism for periodically adding to the balance. Finally, a customer may decide at any time to have you send them a check/cheque or credit their card for the credit balance, so have procedures in place for that.



#29   clustersolutions

clustersolutions
  • Community Sponsor
  • 450 posts
  • Real Name:Tim
  • Gender:Male
  • Location:Los Angeles

Posted 17 May 2015 - 16:38

I thought of your first point way back, but it was just easier to go with the all or nothing approach. This would be "over thinking" it...our credit system has been in place for 8 years now and we have not one request to apply a partial credit. Perhaps we use our credit system mostly for exchanges. I am very sure that this could be easily accomplished should there was a requirement.

 

As for your second point, it falls within your store policy as well as by law. Our store policy store credit is good for up to one year but we never enforce it unless your a real bad customer!!! I sometime wonder since by tax law in the U.S. we are required to keep receipts and records for up to three years so what would happen if I would just keep the money after three year? But that hasn't happened yet. For the second point here, I think it would be too much to ask for a shopping cart to do. That was the reason I said we had a liability account in our accounting system to handle that. It shows a snapshot of our credit liability for tax and accounting purposes. Should I was required to pay interest, I would just setup a recurring transaction in my book to pay those interests. Customer do request converting a store credit to payment, we do do that by removing the store credit in OSC, and then issuing the payment in our accounting system and that amount would be deducted from the credit liability account. Now depending on how long its been since the store credit was issued, for most of the time we ended up cutting a check instead of refunding through the CC.

 

Again, I am a true believer in using the right tool for the right job...I use/integrated sql-ledger for over 10 years now. Lastly, CCVG although being a core code hacker, the work flow it has in place does allow you to automate credit deposit into customer's account as cash back reward, fb like gate reward and etc...well fb like gate's done now but it did its job in getting fb customers...

 

 

 

Could there be instances where a store credit would cover the entire payment due, but a customer might reasonably not want to apply the full credit at this time (just part of it)? Automatically applying the full credit might also leave a tiny balance due that isn't worth charging a credit card for, so the customer might want the option of applying just part of the credit.

 

Also be aware that many legal jurisdictions may require that you pay interest on customer credit balances, so you may need a mechanism for periodically adding to the balance. Finally, a customer may decide at any time to have you send them a check/cheque or credit their card for the credit balance, so have procedures in place for that.



#30   discxpress

discxpress
  • Members
  • 525 posts
  • Real Name:Lecarl Butler
  • Gender:Male

Posted 18 May 2015 - 07:18

@burt

If the credit covers the full cost of the order, disable all available payment methods. Of course you know I'm not a coder, so I don't know if that could be accomplished without hacking the core code. If the credit covers part of the balance, leave the payment methods available and pass the discount to the payment modules like Paypal, Braintree or Stripe(which I use).

I do think this is a perfect opportunity to create a discount module as well. A two in one. There's one question. Should the customer be allowed to use the store credit and discount together? I think not.

Just my thoughts

Edited by discxpress, 18 May 2015 - 07:19.


#31   burt

burt

    I drink and I know things

  • Community Team
  • 12,438 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted 18 May 2015 - 11:49

As of this moment, the system goes like this:

 

Admin Side:

 

1.  customers.php (core code changes)

- addition of extra input box to hold "credit value".

- addition of logic to process this when press the update button

 

2.  customers.php language file

- addition of a couple of text bits for display in the customers file

 

Shop Side:

 

Far more complicated...

 

1.  Creation of Credit Class

- dropped into the classes folder

 

2.  Call the class in application_top.php

- core code change to add the call

 

3.  New CM module to show in account.php

- this displays how much credit the customer has available

 

4.  New "fake" payment module.

 

5.  New Order Total module

- for applying the store credit

 

6.  Hook in checkout_payment

- if the value of the credit exceeds the order_total, this hook does the following;

-- invokes the new "fake" payment module

-- redirects to checkout_confirmation

 

7.  Hook in shopping_cart class file

- this hook reduces the available credit appropriately when $cart->reset happens in checkout_process

 

To Do (possibly):

 

A, Content Module for Checkout Success, showing reduced Credit Balance (of course this reduced balance already shows in account.php)

B, Hook in header.php, to invoke the messageStack - which would show available Credit Balance (would show when customer_is_logged_in AND cart_contents > 0 AND php_self != checkout pages)

 

All in all, a simple system to do a simple and specific task with Minimal Core Code changes.


This is a signature that appears on all my posts.  It is not specifically aimed at you.

 

IF YOU MAKE A POST REQUESTING HELP...please state the exact version of osCommerce that you are using. THANKS
 
If you are still on the old style osCommerce, it is time to move to Responsive.

 


#32   MrPhil

MrPhil
  • Members
  • 6,972 posts
  • Real Name:Phil
  • Gender:Male

Posted 18 May 2015 - 12:49

I thought of your first point way back, but it was just easier to go with the all or nothing approach.

Looking at it from the customer point of view, the more flexibility they have in determining how to spend their credit, the happier they'll be with you. Sure, it's easier to do the simplest thing, but there are advantages to doing harder things.
 

As for your second point, it falls within your store policy as well as by law. Our store policy store credit is good for up to one year but we never enforce it unless your a real bad customer!!! I sometime wonder since by tax law in the U.S. we are required to keep receipts and records for up to three years so what would happen if I would just keep the money after three year? But that hasn't happened yet. For the second point here,

Be careful there! A credit balance is usually legally a debt owed to the customer, that needs to be tracked indefinitely until used, refunded, or discharged by bankruptcy. It's easy for a customer to forget that they have a small credit amount. At some point, you may be required by law to report or even turn over such a balance to the state's abandoned property agency, or to remind the customer yourself. I think it would be advantageous to remind the customer every 6 to 12 months. It's more likely that they will choose to make a purchase, possibly spending extra money, rather than going through the bother of getting a check cut or a credit card chargeback. It's free advertising for you, and not subject to anti-spam regulations. Anyway, remember that they own that money, not you!



#33   clustersolutions

clustersolutions
  • Community Sponsor
  • 450 posts
  • Real Name:Tim
  • Gender:Male
  • Location:Los Angeles

Posted 18 May 2015 - 16:03

@burt, I am looking forward to learn these hooks and apply them...

 

Is step 4 fake payment module necessary?

 

A step may be missing on when the customer select to apply the credit. This a a crucial step that will dictate the codes. A lot of work was necessary for me to simplify the checkout process to two pages and allow the customer to apply the credit during confirmation as it make sense for that step to be there. The original CCGV ask the customer to enter it (I think) in the checkout_shipping/payment page and I found that it was better to group all the payment/billing stuffs on a single page...my $0.02.

 

 

 

As of this moment, the system goes like this:

 

Admin Side:

 

1.  customers.php (core code changes)

- addition of extra input box to hold "credit value".

- addition of logic to process this when press the update button

 

2.  customers.php language file

- addition of a couple of text bits for display in the customers file

 

Shop Side:

 

Far more complicated...

 

1.  Creation of Credit Class

- dropped into the classes folder

 

2.  Call the class in application_top.php

- core code change to add the call

 

3.  New CM module to show in account.php

- this displays how much credit the customer has available

 

4.  New "fake" payment module.

 

5.  New Order Total module

- for applying the store credit

 

6.  Hook in checkout_payment

- if the value of the credit exceeds the order_total, this hook does the following;

-- invokes the new "fake" payment module

-- redirects to checkout_confirmation

 

7.  Hook in shopping_cart class file

- this hook reduces the available credit appropriately when $cart->reset happens in checkout_process

 

To Do (possibly):

 

A, Content Module for Checkout Success, showing reduced Credit Balance (of course this reduced balance already shows in account.php)

B, Hook in header.php, to invoke the messageStack - which would show available Credit Balance (would show when customer_is_logged_in AND cart_contents > 0 AND php_self != checkout pages)

 

All in all, a simple system to do a simple and specific task with Minimal Core Code changes.



#34   clustersolutions

clustersolutions
  • Community Sponsor
  • 450 posts
  • Real Name:Tim
  • Gender:Male
  • Location:Los Angeles

Posted 18 May 2015 - 16:14

Well...definitely another point of view. My experience trend to tell me to limit good options to customer to increase conversion, and doing things the hard way wasn't always better. I ran massive computational programing to learn that a simple stochastic analysis may produce the same outcome.

 

Yep, that's why I stress good "audit trail" and I leave the rest to my accountant. You know I think I still have my Cheese Cake Factory gift card from 10 years ago I wonder if I should still collect...and my VISA gift card had never pay me interest. In fact, I had a Pepboy gift card that still had $10 on it and it expired...damn people...

 

 

Looking at it from the customer point of view, the more flexibility they have in determining how to spend their credit, the happier they'll be with you. Sure, it's easier to do the simplest thing, but there are advantages to doing harder things.
 

Be careful there! A credit balance is usually legally a debt owed to the customer, that needs to be tracked indefinitely until used, refunded, or discharged by bankruptcy. It's easy for a customer to forget that they have a small credit amount. At some point, you may be required by law to report or even turn over such a balance to the state's abandoned property agency, or to remind the customer yourself. I think it would be advantageous to remind the customer every 6 to 12 months. It's more likely that they will choose to make a purchase, possibly spending extra money, rather than going through the bother of getting a check cut or a credit card chargeback. It's free advertising for you, and not subject to anti-spam regulations. Anyway, remember that they own that money, not you!



#35   burt

burt

    I drink and I know things

  • Community Team
  • 12,438 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted 18 May 2015 - 16:19

@burt, I am looking forward to learn these hooks and apply them...

 

Is step 4 fake payment module necessary?

 

A step may be missing on when the customer select to apply the credit. This a a crucial step that will dictate the codes. A lot of work was necessary for me to simplify the checkout process to two pages and allow the customer to apply the credit during confirmation as it make sense for that step to be there. The original CCGV ask the customer to enter it (I think) in the checkout_shipping/payment page and I found that it was better to group all the payment/billing stuffs on a single page...my $0.02.

 

No need for any customer input here, the credit is always applied regardless to the very limit of the credit balance...up to the value of the order_total or the credit balance whichever is the lowest amount.


This is a signature that appears on all my posts.  It is not specifically aimed at you.

 

IF YOU MAKE A POST REQUESTING HELP...please state the exact version of osCommerce that you are using. THANKS
 
If you are still on the old style osCommerce, it is time to move to Responsive.

 


#36   clustersolutions

clustersolutions
  • Community Sponsor
  • 450 posts
  • Real Name:Tim
  • Gender:Male
  • Location:Los Angeles

Posted 18 May 2015 - 16:30

Gotcha...yeah, never had a customer who didn't want to apply the credit ASAP...KISS

 

No need for any customer input here, the credit is always applied regardless to the very limit of the credit balance...up to the value of the order_total or the credit balance whichever is the lowest amount.



#37   MrPhil

MrPhil
  • Members
  • 6,972 posts
  • Real Name:Phil
  • Gender:Male

Posted 18 May 2015 - 21:58

Well, it can vary among legal jurisdictions. If you want to take that money if they don't use it within a certain period, I think you can charge a periodic fee on it, so long as it's clearly spelled out. I remember once being given an Amex gift card, and didn't try using it for nearly a year. By that time, about 80% or so had been taken in fees! Whatever is allowed by law, you should clearly spell out in the T&Cs, and perhaps remind the customer at the time they bank the balance. You don't want to confiscate a non-trivial balance and then have the customer come after you in court. Just sayin'... If you really want to get into a formal store credit program (as well as gift cards, etc.), I would get some good legal advice regarding the laws that apply to your business. Finally, converting a credit balance into a sale (often with more money being supplied) probably makes both you and the customer happy, so that's the way to go. I would never give an Amex gift card, and if I ever receive another, I'll spend it within days!



#38   Mort-lemur

Mort-lemur
  • Members
  • 2,387 posts
  • Real Name:Heather
  • Gender:Female
  • Location:UK

Posted 21 May 2015 - 11:21

Paypal gift vouchers bought against your store go into a "pending" status on your paypal balance - and they do not have an expiry they last forever until used


Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.


#39   burt

burt

    I drink and I know things

  • Community Team
  • 12,438 posts
  • Real Name:G Burton
  • Gender:Male
  • Location:UK/DEV/on

Posted 21 May 2015 - 11:46

What happens if a customer wishes to use his "paypal gift voucher" and pay the rest (eg) "check/cheque".

Possible? 


This is a signature that appears on all my posts.  It is not specifically aimed at you.

 

IF YOU MAKE A POST REQUESTING HELP...please state the exact version of osCommerce that you are using. THANKS
 
If you are still on the old style osCommerce, it is time to move to Responsive.

 


#40   Mort-lemur

Mort-lemur
  • Members
  • 2,387 posts
  • Real Name:Heather
  • Gender:Female
  • Location:UK

Posted 21 May 2015 - 12:01

@burt Not possible - they have to complete the whole transaction via paypal


Now running on a fully modded, Mobile Friendly 2.3.4 Store with the Excellent MTS installed - See my profile for the mods installed ..... So much thanks for all the help given along the way by forum members.