Contribution Talk: QPBPP 1242

Whenever I use a pre-existing contribution, I’ll make a short blog post to let you know how the install went, and how easy the contribution is to install.

Quantity Price Breaks Per Product (aka QPBPP),1242

The task was to install this on a very highly modified shop. This shops admin category page has at least 5 other contributions code changes, some custom coded by me, some added by the client. Hence I could not just “drop in” the files.

I had to merge the files one by one, by hand. Using winmerge makes it rather easy, however I decided to simply follow the install instructions as they are put together quite well…

In use, it works flawlessly. I managed to easily add price breaks to the product.


Ease of Install: 6/10 (good considering the shop is highly modified)
Ease of Use: 8/10
How it looks: 3/10 (it’s ugly in the extreme, I modified a file to change this)

Changes I would like to see

The NEW files added to a folder so that any new files can just be dropped in, without accidentally over-writing existing files.

Extra Info

I have modded the PriceFormatter.php file to output the price breaks in a cleaner fashion. If anyone wants this, please let me know, feel free to “beer” me for quicker service. Burp.

Before (takes the style of the infoBox):


ClubosC Discount System and WPosC

WP.osC (WP-osCommerce) is a modified version of osCommerce, one of the most popular ecommerce solutions. The main difference between WP.osC and osCommerce, is that WP.osC uses the same Theme system as WordPress.

Seems as though this is (another) fork of osCommerce. Anyway, I have been playing with this system for a couple of hours and can confirm that my own ClubosC Discount System does work with this fork (with a bit of finagling!).

As my Discount System touches very few files, it’s probably the only Discount System that will work as intended with wposc, as wposc changes files considerably.

For installation of my Discount System on your wposc shop, please contact me directly on

Update on ClubosC Discount Coupon System

Had more than a few enquiries asking as to the present status on my Discount/Coupon System, so here goes;

It is presently at Version 5.0. Installation is available on any shop, however modified. v5 is suitable for both RC versions of osCommerce and MS versions of osCommerce. It is also suitable for the “osCommerce Project” version of osCommerce.

Admin Side

1. Ability to add Coupons to give a percentage discount
2. Ability to add Coupond to give a fixed amount (money off) discount
3. Ability to set a Minimum Spend (before a Coupon can be activated)
4. Ability to set Multiple Use per Customer
5. Ability to set One Use per Customer
6. Ability to set One Use by one Customer (Coupon automatically deactivates after 1st use)
7. Ability to see all orders made using individual Coupons
8. Ability to see when (date and time) each individual Coupon was last used
9. Ability to see how many times each individual Coupon has been used
10. Coupon amount shows in each individual order
11. (NEW!) Coupons can now have expiry dates

Shop Side

1. Small change in /includes/boxes/shopping_cart.php to show discounted total
2. Coupon input box now in shopping_cart.php (rather than part of the checkout process)
3. Ability to remove a Coupon after it has been applied
4. Coupon discount amount shows in a cleaner format on the Shopping Cart page
5. Coupons now work with Tax calculations
6. Coupon amount shows in the final cost of the purchase
7. Coupon amount shows in Order History

That’s about it. It’s a solidly coded Discount/Coupon System that is fully supported by me.

Future Updates

1. Ability to add Coupon expiry date COMPLETED, see comment below.
2. Add System for purchasing Gift Vouchers

If you would like to have this installed on YOUR shop, please get in touch with me by email, my address is up there ^

Attributes, Options, osCommerce

In standard osCommerce, the product options system (aka attributes) is almost completely useless. The reason for this is obvious – attributes cannot be linked together to make a meaningful “sub-product”.


T-shirt – 12 in stock, of which:
3 are blue, large, round neck
4 are red, large, v-neck
2 are blue, small, round-neck
3 are blue, xxl, round-neck

In that example, you have only 1 product, but you need to set up “colour” (red and blue), “size” (s, l, xxl) and “style” (round neck, v-neck). In the standard attribute system, this will give you three dropdown menu’s showing the available options. Follow me so far?

What it means is that a potential buyer could choose a bunch of options that are simply not available – example: xxl, red, round-neck. And they would be able to check out. When they check out, overall stock is reduced by 1 bringing your number of available shirts down to 11.

But you have just sold something that does not exist…are you with me?

OK, so there are some steps you can take to combat this:

1. Install something called “QT Pro” – which is PITA to install and has many bugs.
2. Install “Master and Slave Products” – which is easier to install, but also has problems – it’s ubnwieldy in real life use.

Here’s my idea for a rework of the attribute system…

1. Allow the store owner to insert options as per normal.
2. Have an extra “options” page which will allow the store owner to make “attribute sets” (explanation below)
3. Assign these “attribute sets” to products.

What is an attribute set?

In the example above, this:

blue, large, round neck

is an attribute set. The store owner would link 3 options together and be able to insert the quantity available. He would also be able to give the “set” a SKU.

Then, in the product_info page, SKU’s would be shown, like this:

Description, blah blah
In stock:
( ) blue, large, round neck [SKU: qwerty123] – 3 in stock
( ) red, large, v-neck [SKU: qwerty124] – 4 in stock
( ) blue, small, round-neck [SKU: qwerty125] – 2 in stock
( ) blue, xxl, round-neck [SKU: qwerty126] – 3 in stock

Now, the next part of this modification, would be subtracting stock, this would be done in two stages. Let’s say the buyer purchases 1 of “qwerty123”. The overall stock of t-shirts would decrease from 12 to 11 and the stock of “qwerty123” would decrease from 3 to 2.

How does that sound? Can any of you see any flaws in my thinking? Anyone got any ideas to add to this?

Coupons for MS2

I spent some time and got my Coupons Version 5 working with older osCommerce – MS2. So now you can have one coupons even if you are running an outdated version of osC. Get in touch if you need this.

Coupons Version 5.0

In my last post about my Coupons system, I signed off by saying this:

V5 – in the pipeline

Minimum Spend per coupon.

A “use once, one time” coupon. Once that is done, I can then look at the flip side of discount coupons, which is “gift vouchers.

I’m glad to say that both of these are now completed, so I’ve upgraded the status of this coupon system to “Version 5”. The minimum spend is live on some real stores, however, as of right now, no-one has the “use once, one time” coupon.

Minimum Spend per coupon

This is simply an input field, into which an amount is inserted. If the cart total is LESS than this amount, an error message is displayed along the lines of “please spend an extra $xx.yy to redeem this coupon”. It’s pretty simple and works well.

use once, one time

This is simply another selection under “Coupon Usage”. If you select “once”, then the coupon can only be used once. The coupon is set inactive at time of use. From my testing, it works very well.

As per recent versions of my coupon mod, this is only available for RC releases of osCommerce and is only available installed – if you are interested, please do contact me on

As an aside, I also wanted to point out that I have a few free eBooks available – have a hunt around my other site at – I’ll make a proper post about it in the next few days.

Blacklisting a Customer in osCommerce

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!

Version 4 of Coupon Discount System

STOP PRESS: This contribution is now updated to Version 5 and has all sorts of cool extras. Please see the latest post about this.

I’ve been slowly but steadily working on this contribution when I can find time in my schedule to do so 😉 Seems as though there are a lot of requests but hardly anyone is willing to help further this modification by donating to the project…

V4 – Admin Side:

Able to add a “use once” or “use multiple” voucher.

Able to add a “fixed amount” or “percent discount”.

Each Coupon shows the date/time of the last use (linked to the order) and the total number of uses.

This link enables you to quickly see every use of each voucher.

This list shows each use of the voucher. Each use is linked directly to the actual order made.

You can disable coupons easily by clicking these buttons.

Version 4 – Shop Side:

The Coupon Input box is now in the shopping cart page. This means that other contributions such as “FEC” should work OK.

Inserting a valid coupon code changes the value of the cart contents appropriately.

The “remove coupon” link does just that – it removes the coupon from the order.

The checkout_confirmation.php page shows the details of the order as usual, including the coupon.

And the same information is shown in the admin page for the order.

V4 – under the hood

Version 4 has had quite a lot of code changes – mainly to deal with the fact that coupon discounts can now be placed outside the checkout procedure.

V5 – in the pipeline

Minimum Spend per coupon.

A “use once, one time” coupon. Once that is done, I can then look at the flip side of discount coupons, which is “gift vouchers.

Donate To Charity – Reloaded!

OK, so it was brought to my attention that my system only is available at the same time as purchasing a product. There is a good reason for this => it’s an order_total module so it needs to have an order made to process it – and standard osCommerce does not allow an order to be made without products…

So, with a bit of lateral thinking I came up with a solution – use a faux (false) product. Easy in theory and fairly easy in practice…

1. Need to recode the shopping_cart box to always show the cart subtotal. Needed to do this to show the inputted charity amount even if no products are in the cart.

2. Need to recode the shopping cart page to show the update cart, checkout, buttons at all times. Needed in order to be able to input the charity amount and begin the checkout procedure.

3. Need to recode the checkout_shipping page to add 1 extra line of code to add a false (cost zero) product if the cart has a total of exactly zero items in it, and the cart total does not = zero. In other words, a charity donation. If there is already a real product in the cart along with a donation, then this is un-needed of course.

4. Add an extra contribution to skip the checkout_shipping calculations if the cart only has the faux product and donation in it.

5. A couple of small changes in application_top.php in order to deal with the adding and removal of the charity amount, and consequently the adding and removal of the faux product.

Here is a video showing the system in action. Obviously it still needs cleaning up a lot (sponsor needed for this if anyone is interested), and is on my test shop hence the messy layout. But it should give a general idea of where the contribution is at right now.

Code one thing, and find a solution for another

Over in the osCommerce forum, someone is after a “donation” contribution whereby a buyer can insert an amount to donate which will then be added to the cart total. I guessed that a competent(ish) coder should be able to get something workable within half a days worth of coding time. So I set out to make something that would work – it took all of 30 minutes.

Anyway, that’s by the by – the point of this blog post is that whilst I was coding this up I struck on an idea of how to remove discount coupon after it’s been applied – which is something that a lot of people have been asking for…

Have a look at this video

Hopefully it’ll show the “remove coupon” link next to the details of the live coupon, which, when clicked will remove the coupon entirely…

I’ll add this into the code for Version 3 of the coupon discount system.