Blacklisting a Customer in osCommerce

By | October 29, 2008

The other day, one of my cliets approached me as she has been having major problems with one particular person signing up, buying and doing a chargeback. Of course, this is not desirable, so we had a brainstorm to see what could be done about it…

Blocking the IP: not really, as people can still get dynamic IP addresses.
Deleting the customer account: not really as the person could just sign up again
Making note of his CC number and not allowing him to use it: no, as it’s not allowed to store CC numbers

The only solution we could come up with that works to any satisfactory degree is to simply not aloow this person to log into his account anymore. Of course, this is still not a perfect way to do things as the person could just make a new account, but at least he cannot make a new accoutn using the same email address.

With that decided, I went on the hunt for a contribution that would allow this and came across this one. It’s a bit of a clunky coded contribution but seems to do the job OK – and as I was pushed for time I thought it would be OK to install this.

A new client

Yesterday, someone else asked me to do the same thing – and as I had a little time on my hands I decided to have a think about doing things a different (and better in my opinion) way. I really like the “green and red” on/off buttons in the category/product pages in osCommerce admin – so I wanted to use those to allow the Shop Owner to ban or unban a client.

Here’s a screenshot of my idea;

Those customer with the “red dot” are banned. If they try to login, their session is destroyed, their cart is destroyed and they are redirected to “login”. I haven’t coded most of this up (yet), but envisage it takeing next to no time to get working. My idea is also to have a date setting to show when a person was banned, as well as showing the latest login attempt.

Should be an interesting coding challenge, I reckon it’s doable in less than 20 lines of code from start to finish…of course, it then needs testing which takes some time!

8 thoughts on “Blacklisting a Customer in osCommerce

  1. Gary Post author

    This is now coded up – it took 1 line of code in login.php and 4 tiny changes in admin/customers.php, 1 new function and a couple extra database rows (one for banned status and one for banned date). Easy as 123.

  2. Alistair Macneil

    Hi Gary, this is the 2nd time I have come across your site in recent weeks, so will be adding to favourites now.

    Is this code available anywhere, I am needing to do just this and your solution looks to fit like a glove.

    don’t reinvent the wheel 😉

  3. Gary Post author

    Al – this code is not available, but if I have time I will make it into a contribution.

  4. AndreKrieg


    Gary, got time to make the contribution? Is the code available?


  5. Gary Post author

    Andre – I wish there was 48 hrs in a day. It’s on the list of to-do’s but pretty low down to be honest.

  6. PGelsman

    I’ve got a contribution installed on my Control Panel. Something you might want to add to your contrib. is the ability to include a comment field to reference why the customer was blacklisted etc. Also a chcekbox to alert you when he/she tries to log in.

  7. Gary Post author

    Hi – this would not work in my solution (without a fiart bit of extra code) as I only have a red/green selector to turn customers “banned” or “unbanned”.

    I don’t intend updating this script, and it is still on the list of to-do’s to upload to the contributions area of the osCommerce site.

  8. Duarte

    Hi Gary. The SPPC could also be used and disable credit card payments for this customer! I know SPPC is hard to install!!!

Leave a Reply

Your email address will not be published.