Customer Group? SPPC? Something else!

By | April 7, 2010

I have a long term client, whose site has absolutely loads of contributions, including some big ones such as “Quantity Price Breaks Per Product” and many other small tweaks here and there.

The client wanted the ability to set up 1 particular group of customers who get charged more than the standard group. Basically a bit like a wholesale discount, but in reverse.

As the site has so many changes to almost all the files, I decided that installing Customer Groups or SPPC would be too much work, so I set out to make my own, cleanly coded solution.

Step 1. Allow the ability to set each customer to “pro” or leave as “standard”. I did this using a flag system in the admin/customers.php page;

Step 2. Allow the ability to make the “pro” customer get a % increase. I did this by making a new configuration definitiion;

Step 3. Recode login to start a session to see if the customer is “pro”.

Step 4. If the session exists, increase all prices by the % increase. This involved changing code in a few files, from the top of my head;

a. includes/classes/shopping_cart.php
b. includes/modules/order_total/ot_total.php
c. includes/modules/order_total/ot_subtotal.php
d. checkout_process.php

All in all, this took a couple hours to code up, much of which was spent making test orders to be certain that “standard” customers get charged the standard price, and “pro” customers get charged the pro price.

Interesting little project!

2 thoughts on “Customer Group? SPPC? Something else!

  1. Kalvir

    Please host the code for this,tried but giving errors at some places,I just need to set a customer as pro/standard part

  2. Gary Post author

    This code was only made for 1 particular client. I would need to ask that client for permission to distribute and then move the code to a clean install of osCommerce. If you wish to sponsor that, let me know oscshops@gmail.com

Leave a Reply

Your email address will not be published.