Lead Time – handmade products

Project for today was to build a system to allow a shopowner to assign a leadtime to products. For example, a hand made product that takes 3 days to produce. Now imagine shopowner sells 50 or 60 such products, some of which can be sent immediately, some take 3 days to produce, some take 5 days. Or another scenario is if shopowner has a supplier who takes a little time to get products to him to resend to customer…you get the idea, I’m sure.

So, shopowner can now set up individual products to have a “lead time” in days;

Of course, products could all have the same amount of lead time, or could have different amounts. I then made logic that grabs the value (in days) of the product being purchased that has the highest leadtime and works out the next available working day based on this;

In this example you can see the matrox has a lead time of 5 days, and the printer has a lead time of 1 day. The message underneath takes the higher amount of days and works out 5 working days from order date. Saturdays and Sundays are not counted as working days, and I have also added the ability for the shopowner to add in bank holidays, vacation time and so on.

In the checkout process, I also show a similar message;


A good way for shopowner to let customers know that some products are not available immediately!

2.3.1 to 2.3.2 upgrade service

2.3.1 to 2.3.2 upgrade service

For those people who do not want to tak the chance of upgrading their shop(s), I install the new password reset functionality, and fully test it. It does not matter if your site is modified by addons or templates – I guarantee a fully working upgrade of the password functionality.

The service is going to be a “beer fee” of £20 per osCommerce install, payable by Paypal. If interested, email me on oscshops AT gmail DOT com

Please bear in mind that I require FTP access to your existing 2.3.1 shop, also that I will create an account at your shop (to test the new functionality). If your site runs multiple languages, you will need to translate for me.

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

Products to Specifications and Customers to Specifications

Earlier in the year I created a “products to specifications” system – it was created specifically for a Pet Shop where the site owner can say “this product is good for Rabbits, Guinea Pigs, hamsters” and so on. This can be done for an unlimited number of specifications on an unlimited number of products. So, 1 product is great for this and this, another is great for this and that, another is great for that and that. You get the idea, I’m sure. The Admin Area looks like this (product adding/editing page);

Fast forward 6 months, and it is now time to do another portion of the Specifications project. This portion is to allow the customers of the shop to tell the Shop Owner what animals they own. Once coded it will look something like this;

The available animals are the exact same as in the admin area. When the Shop Owner adds or removes animals, these options update. The Customer ticks the animals they have and this data is saved in a new Database table. When they acquire a new animal, they can easily update in the customer_account page.

What is the reason for knowing the animals a customer has? Anyone have any idea(s)?

Filtering and Sorting Specials

Late last night I came across an interesting post from Carine, where the need is for filtering and sorting of the special offers. I’m intrigued to see what Carine comes up with…

In the meantime, I decided to code up something very quick and dirty on the specials page only. I chose the easiest options and came up with a way to filter on;

– manufacturer
– % of the discount

and sort on;

– amount of the discount

In addition I wanted to ensure that selected sort/filter is maintained even if another sort/filter is chosen. In this way I can say (for example) “show me discounts above 25% on products by Microsoft, sorted from high to low”. This makes the specials very easy to find, and would be useful for those shops who have many special offers running at one time.

There’s no limit to how many filters/sorts can be run at one time, as all the filters/sorts do is change the SQL command that grabs the products from the database.

Here’s an example video, showing some sorting and filtering;

Some more examples (would just need a link added, and some extra SQL);

– filter specials to show all DVDs on special offer
– filter specials to show all DVDs only from Warner that are more than 50% discounted
– sort specials by original price

I’m sure that we can think of many more. And all are possible, why not?


A good idea by Carine, and useful for allow potential clients to drill down through your special offers to find what they are looking for faster. Which can only be a good thing.

Contact Form on search results?

The other day I wrote about my new “fuzzy search” which brings more power to the search function of osCommerce. My friend Paul asked about having a “contact form” on the search results page. My idea was to have a form show if the fuzzy search results show.

So, now the advanced_search_result.php page looks something like this;

Now the person searching has the ability to see “exact matches” as per usual osCommerce and “fuzzy matches” as per my update and a “form” to easily contact the Shop Owner. The form utilises the usual osCommerce structure, including error messages as appropriate and action_recorder.