Hazmat Module updated for oscmax 2.5

A long time ago I wrote a Hazmat module which allows the shop-owner to add a charge for shipping hazardous material. You can read more on this blog post from over a year ago.

At the same time, I recoded it to suit osCmax as a few of my clients use oscMax. At that time osCmax was pretty much osCommerce 2.2 with a few extras. Fasty forward 18 months or so and osCmax2.5 has been born. It is still pretty much osCommerce 2.2 with a few extras, but there have been some developments in what has been added. The two main things being QPBPP (Quantity Price Breaks Per Product) and a 1 page checkout.

These two additions change the way in which osCmax works quite a bit. They add some extra complexity behind the scenes, particularly QPBPP (which is a useful addon, but changes too many core files).

For this reason I had to recode the Hazmat Module…to deal with the changes. And pleased to say that it works well.

Thoughts on osCmax 2.5

Code is stuck at 2002. It’s 2012 now, so the underlying codebase needs to be updated desperately. The main problem is that oscMax is full up with other peoples addons, which (being honest) are sometimes not of a good enough quality to make it into core code. Michael needs to step up to the plate now, and serve something better than outdated tables based code. Time to fork osCommerce 3…

NoIndex Header Tag Module

Sometimes you might want to have Google and other (are there any other?) search engines not show certain products in your site. This is where noindex is worth some value. Have a read of this Google Support page.

With that in mind, we know that any page with noindex will eventually be removed from the Google results pages. It might take some time, but it will happen when the Googlebot hits your page and reads the noindex tag.

Took me all of 10 minutes to code up a quick and easy mod to enable shop owner to set each product to index or noindex. Default is, of course, index!

Admin side:

An extra red/green selector;
red = noindex
green = index

Shop Side;

No outward change, but looking at the underlying code of the page, this is added if a product has that red selector;

This is done using a Header Tag Module

The benefit to this is that these modules are drop in, so there is not any need to amend the code of the product_info.php page.

Be aware that some people giving advice at the osCommerce sell SEO services and therefore are going to try to confuse the hell out of you by spouting shite.

Date and Time Choosing Project

Quoted a new client the other day for an install of the Date/Time chooser for deliveries, but with some added extras, namely;

Rule 1. Deliveries can only be selected from Tuesday to Saturday.
This took a small function to exclude sundays and mondays from the datepicker display.

Rule 2. Delivery slots are available only from 11am to 2pm
Subject to rule 1 days, and in 15 minute slots; 11, 11.15, 11.30 and so on. Fairly straightforward.

Rule 3. Delivery days can be booked upto 6 months in advance.
Again, straightforward.

Rule 4. Delivery slot can only be booked for the next day if ordering before 8pm the day before.
If after 8pm, the earliest delivery is the day after next (subject to rule 1). 1 line of PHP deals with this.

Rule5. Time is to be determined based on New York time. The server is located in Texas.
1 line of PHP solves this.

So, I made it…

As I had some time free today, I coded this mod whilst waiting on the client to decide whether or not to accept my quotation.

The modification turned out very well, and is using a minimum of code for all the necessary calculations, mainly HTML (php) for the layout, a couple of lines of PHP code to ensure stability of New York timings and a few lines of javascript to power the whole thing.


osCommerce is probably not the best tool to use for taking orders (this modification is for a restaurant), but it can be made to act in any way needed, with some coding finesse.

Admin Create Customer Account

Someone at the osCommerce forum posted for a way to manually create a customer account in osCommerce 2.3.1. A similar addon does already exist for older versions of osCommerce, but the code leaves a bit to be desired.

Step 1. Create the “Add A Customer” form to the admin

– copied the create_account.php page from the shop side and made a few changes to suit the differences in code between “shop” and “admin” files. Also ported over any included files (such as form_check.js)
– removed some of the un-needed code from the file
– amended other files to suit (filenames.php, language files and so on)

Step 2. Add the link to the new page into the customers infobox

And here it is in action;

This will be released into the osCommerce App Store when it opens to the public, until then it is available directly from me as a commercial addon, priced to suit your site (including installation).

Got Fork? Make sure you know enough…

The other day I was contacted via email by a member of the osCommerce forum asking a very basic question about how osCommerce displays categories.

This person offers a fork of osCommerce…in my opinion anyone who forks needs to have enough knowledge to not ask ANY questions in the osCommerce forum, or make sure that they have a team around them who can deal with these situations.

Am I being unreasonable?

Bundle Products 2.3.1

In response to an idea from a long-standing customer, I’ve been working on a system that allows the Shop Owner to make a product that is made out of other products.

Imagine for example, a shop that sells plates, knives, forks, spoons, cups, glasses – and they want to sell a “bundle” of those as a “Dinner Service”. Or perhaps a surfing shop who wants to put together a “beginners bundle” of wetsuit, rash vest, surfboard, leash – these items would be “slaves” of the beginners bundle.

So, I set about making it. It was actually fairly straightforward up to a point. In the following, I’ll take the “surfing” idea;

Firstly, the Shop Owner needs to add the slave products (board, wetsuit, leash, vest) – this is done in the usual way via the admin section.

Step 1: add the master product AND the ability to add slaves (and their quantity) to that product. This is done in the usual way, via the admin area. However, there is a new addition on the product adding/editing page, as so;

The ID input box is the product ID of the slave. The quantity input box is how many of that ID are included in the “bundle”. More slaves can be added by pressing the +Add Slave link;

Once the product is ready, press “save”. The bundle is now available for sale in the shop. At this point, the Shop Owner is expected to have made a good description for the bundle as I have not coded an automatic way for the bundle to show it’s slaves. Would that be needed?

Step 2: Buying the Bundle. This is done in the usual way by the customer, using the usual checkout process. Once the bundle is purchased, the quantities of all the slaves are reduced appropriately. In this way, stock control can be maintained.

Have a look at this video which I made, which shows a different example. In this one the “Test Product” is a slave of the “Graphics Card”.

To Do:

1. Show Slave Products on the Master product_info.php page.

2. Check stock of all slave products before allowing checkout (by this I mean that if a master needs 4 of a particular slave, yet only 3 slaves are in stock, pop up the out of stock message).

Let me know what you think of it so far?

Shipping Prices per product (for two regions)

Anyone got an idea on how to do this? I’ve never used the “multi geo zone” shipping mod so not 100% sure if it would work well…


Product A shipping = £2.50
Product B = £1.99
and so on

Rest of the World
Product A shipping = £4.20
Product B = £4
and so on

My initial thought was to put in a couple more boxes in the product adding/editing page in admin;

UK shipping cost: [ ]
ROW shipping cost: [ ]

Then make a new shipping module to suit those inputs. But if there is something already made that does the same, and it’s well coded, let me know please. This would be for a 2.2 shop.

Market Research, please help…

I’m considering setting up an “osCommerce Club” where I would charge a monthly subscription fee.

All subscribers would get access to bits and pieces (such as small snippets of code) that I do not release publicly – as well as one “large” contribution (eg a template, or a module like that “article manager” I blogged about) per month…

If I was to start a subscription offer like that, would there be an interest, at, let’s say $20 usd (£10 ukp) per month.

Let me know your thoughts, good, bad or otherwise.

102 and counting…

Last week I cleaned a locked down another 4 hacked osCommerce sites – which takes the total to 102 that I have personally cleaned, I suspect there are a few more developers who have cleaned as many if not more. osCommerce is a magnet for hackers.

Anyway, of the 102 that I have cleaned, only 1 has been subject to rehack – after much investigation it -appears- that the clients computer is infected, possibly using a variant of Gumblar, as it seems that each time he FTPs using a certain piece of software, his site is hacked within a few hours. It’s a strange case.

I’m seeing more and more hacked osCommerce sites – with some shop owners completely unaware until Google tells them it’s a “malware” site – then it’s noticed pretty quickly.

If you are unsure about your osCommerce security, contact me on oscshops@gmail.com to book a quick scan of your site – I’ll let you know about any insecurities and give you a guideline on how it can be cleaned and/or secured.