About Club osCommerce

Showcasing osCommerce…the good, the bad and the ugly!

Follow osc_pro on Twitter

Blacklisting a Customer in osCommerce

Written By Gary on Oct 29 2008 · Comments (8) Follow osc_pro on Twitter

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!


Buy Gary A Beer?
Buying me a "beer" helps me to keep my contributions updated and keep this blog alive - and you get a link from my homepage to your site. Cheers!


8 Comments

  1. 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.

    Comment by Gary — October 30, 2008 @ 11:43 pm


  2. 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 ;-)
    Alistair

    Comment by Alistair Macneil — November 4, 2008 @ 10:50 pm


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

    Comment by Gary — November 6, 2008 @ 10:59 am


  4. Hey!

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

    Thanks!

    Comment by AndreKrieg — December 14, 2008 @ 11:39 pm


  5. 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.

    Comment by Gary — December 16, 2008 @ 11:32 am


  6. 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.

    Comment by PGelsman — February 21, 2009 @ 4:04 am


  7. 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.

    Comment by Gary — February 22, 2009 @ 6:05 pm


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

    Comment by Duarte — July 8, 2009 @ 11:07 am


Leave a comment

RSS feed for comments on this post · TrackBack URL

Hot 100 osCommerce Shops

View the osCommerce HOT 100These are the best looking, most exceptional osCommerce Stores as voted for by you.

New to osCommerce - get inspiration from these beautiful shops. Reckon your site has what it takes to become a member of the HOT 100? Submit it!