Turn ordering off when on holiday?

Had a few requests for “turn ordering off when I’m on holiday” and yesterday managed to find the time to put it together.


1. Ability in admin to turn off the checkout system, or leave it open
2. Ability in admin to set up a “we will be back on {date} message” and other “info” messages
3. Show an obvious message in the header of the shop
4. Show an obvious message in the header of the admin area

In less time than it would have taken to find a suitable existing addon, amend it appropriately and install, I made a new modification – with a few database entries, 1 block of code in admin/includes/template_top.php, 1 block of code in both stylesheets, and 1 block of code in includes/template_top.php.

Here is how it looks;




So, the admin can choose between 3 options;

a. Checkout = open. Checkout is as normal, no messages show.
b. Checkout = closed. Checkout is closed, those trying to checkout are redirected to shopping_cart page.
c. Checkout = partial. Checkout is as normal, but messages do show.

All in all, a nice little modification that has very little weight of code, so is easy to install on any osCommerce shop, even highly modified templates.

osCommerce, Open Source and how to get to grips with Commercialism

osCommerce is not and never has been a “no money” entity. Don’t believe me? Let’s look at the facts;

1. osCommerce is supported by community sponsors. They pay for that pleasure.
2. osCommerce is supported by corporate sponsors. They pay for that pleasure.

Open Source is all about “freedom”, not “free”.

1. A freedom given to you is the freedom to do what you like with osCommerce
2. That freedom is also given to me as a developer

Never forget that we all have the same freedoms as each other.

Here’s a typical comment of the sort that I receive now and then, from “Joe Average” shopowners;

Its people like you that make money from a free product

OK. That is a freedom granted to me. My response to this type of comment is always;

Is your shop running on osCommerce making you money?

There is never a response to this, as with those 9 words I have rendered that entire argument null and void. Here’s another typical comment;

Whats not in your interest is to have a loaded osCommerce option as you would loose part of your income.

Let’s look at Magento which (for this blog post) consider as “osCommerce on Steroids” – by this I mean it has a lot of things built in to the admin section (loaded in other words, with goodies). What this means is that if the Joe Average shopowner wants to do something that exists as a “goodie” it’s very simple, he clicks a button…and it’s all working. If he wants to do something out of the ordinary, it’s impossible – he/she is forced to use a developer. So, on the face of it, I might lose business, but I believe that I would gain a lot more than I lose.

Me choose…

For me, Open Source is also all about CHOICE. The choice to use it, the choice to amend the code oneself, the choice to contract a developer to make code changes. Once choice gets taken away, the product is in trouble.

The more bloat you introduce to osCommerce, the less freedom one has in its use. I don’t know why some people find that concept hard to grasp and I for one find that quite sad.

You can CHOOSE to use osCommerce. You have that FREEDOM.
Remember this: so does the next man.


The next time you feel hindered by Open Source, think about a choice you have: the freedom to find a new Open Source product to use.

Comments are now powered by Disqus

As I have been getting so mcuh spam lately, I have updated the comment system to Disqus.

I’ve queue’d the existing comments for addition to Disqus which is why they are not presently showing. It takes upto 24 hours for the comments to be inserted in Disqus.

Table Rate Shipping based on highest weight product in cart

I needed to quickly code up a shipping module that is just like table rate, but instead of calculating “total weight” it calculates only on the weight of the heaviest product in the cart.

With some fairly simplistic code, I made it happen.

Step 1
Create an array of product weights as part of the shopping cart class. Like so: 1,7
In this case the total weight of the 6 products is 8kgs (1+7). The highest weight is 7kgs.

Step 2
Read the highest value and use that in a new module based on table rate.

It ended up like this:

This is based on the same shipping cost for both “max weight” and “table” which are both (for this example):
In other words; up to 7kgs: $2.50, to 50kgs: $5.50

If we work on the basis of TOTAL weight, the cost falls into the up to 50kgs slot as the total is 8kgs.
If we work on the basis of “weight of heaviest product only”, it falls into the upto 7kgs slot.


A very quick and simple project completed for a site going live today. Now the shopowner can offer mixed shipping for heavy and light products.

osCommerce 2.3.2 to be released shortly

Hearing on the grapevine that osCommerce 2.3.2 is to released shortly.

Changes from 2.3.1 to 2.3.2 (not scientifically exact, based on my looking at the files)

1. shopping_cart.php – Remove hardcoded language words
2. product_info.php – redirect to index page if no products_id is available
3. product_info.php – solve incorrect number of reviews bug
4. password_forgotten.php – new password reset functionality
5. login.php – new password reset functionality
6. index.php – cure manufacturers display bug
7. checkout_process.php – error check on $product_attributes
8. checkout_confirmation.php – error check on POST $comments
9. checkout_confirmation.php – error check on $confirmation
10. includes/version.php – update version
11. includes/filenames.php – add 1 page
12. includes/modules/new_products.php – count on $num_new_products
13. includes/functions/html_output.php – remove an unwanted character
14. includes/functions/general.php – solve malformed url problem
15. includes/functions/general.php – new password reset functionality
16. includes/classes/passwordhash.php – new password reset functionality
17. admin/reviews.php – fix a misspelling x 2
18. admin/mail.php – solve outgoing email issue
19. admin/define_language.php – use lngdir instead of $language
20. admin/categories.php – remove camelCase
21. admin/action_recorder.php – solve multiple instances of aID in URL
22. admin/includes/modules/dashboard/d_reviews.php – add ending href
23. admin/includes/modules/dashboard/d_orders.php – add ending href
24. admin/includes/modules/dashboard/d_customers.php – add ending href
25. admin/includes/functions/html_output.php – remove unwanted character
26. admin/includes/functions/general.php – solve malformed URL problem
27. admin/includes/functions/general.php – increase randomness
28. admin/includes/classes/passwordhash.php – increase randomness

A new look

I decided to open up the blog to carts other than osCommerce. I work quite a bit with other osCommerce forks such as Zen Cart and particularly osC Max – so why not be a bit more responsive to users of those. The main emphasis will still be osCommerce.

As I am opening up the blog for other carts, I thought I might as well give it a new look. My attempt is to make a move away from a blog and more into a blog/site hybrid. That’s why the front page is now more of a call to action page – over the coming days there might be more changes to the look/theme.

My idea is to keep on blogging as I have been, but also to put up some informational pages about the services I offer, the products I sell, client testimonials and so on. It’s time to get a bit more organised and time to make clubOSC a bit more professional!

Guest posts

I also want to start a series of guest posts from shopowners – who can talk about any aspect of their shop. And obviously link to their shop. If you run an ecommerce shop and you would like to make a guest post, please email me and we can go from there.

Got ideas, comments, suggestions

Feel free to let me know, by commenting here, or by emailing me. I’m open to any and all suggestions for the site.

Also Purchased Module AFTER clicking the buy button

I have always been of the opinion that the usual way in which osCommerce shows the “also purchased” is a bit flawed.

Usually it is simply shown on the product_info page, at all times – and is a list of other products that buyers have bought at the same time…example.

With some thinking, I moved it into the “you’ve added box“. So that it now looks like this;

So, now the buyer gets the “also purchased” items as part of the action they just took, rather than something which could possibly stop them buying the item they are looking at.

Seems to work very well, and has already been proven to increase sales! If you want/need something similar, email me for a quote.

osCommerce Forum opens up to Commercial Interest

It’s been a long time coming but at last the osCommerce Forum has become more open to commercialism in terms of people asking how/where to find developers and for coding projects.

This will hopefully be a very good alternative to the usual places that people find coders such as the “lancer” sites and so on. Being able to go direct to the forum (of the software you are using) has to be a better way to find a quality developer than using a site where you have no clue what the coder might be doing to your site.

The two commercial forums are for 2.x and 3.x osCommerce, and are protected forums…meaning that the general public can not see topics being posted.

Well done Harald, I appreciate the difficulties in bringing commercial interest to osCommerce – hopefully it will be a great benefit to the community! In the future, possibilities exist to extend this, with osCommerce being able to benefit financially from it. Stay tuned!

Autocomplete the Search Box

Was reading the jqueryui site the other day and came across an interesting tidbit; autocomplete feature is built in. That got me to thinking, why not autocomplete the search box with the products name;

That’s the finished article, and as you can see selects the products name (in the correct language) based on the input of the box.

With some thinking, I was able to write a tiny background script to grab the results of a MySQL search based on the keyword in the input box. It took me a half hour to realise that the autocomplete feature sends $_GET[‘term’] – so watch out for that!

I then added a class to the search input box, and joined the jquery trickery to it;

And here is a video of it in action;

I was going to add it to the add-on’s area of osCommerce, but when I got there I found almost the same thing already made, so I did not bother (as you can plainly see in the image/video that it is made on a clients site meaning I would have to re-do it for a basic 2.3.1). Might as well just use the existing one, unless anyone really really wants my version

Import Customers

I have been working on a script which imports customers into osCommerce, based on a spreadsheet of customer details. It’s a little difficult as the customer data is patchy and I’ve had to write some custom functions to get the ID of the customers country and so on.

The reason for writing this is to save the shopowner from manually adding 3700 customers! This would take too long. So, I wrote a PHP script which reads a spreadsheer (90% of my work seems to be using CSV files!!), and it seems to work good – 90 lines of code which imported 3700 customers (including address book) in around 40 seconds => saving my customer weeks and weeks of data input.

Script is completely useless for any other shop owner, as it is set up to read his spreadsheet columns. But the same can be accomplished for anyone else wishing to import many customers in one go, get in touch.