Hot 100 – the best themed osCommerce shops

Quick update on the Hot 100 as I haven’t done this for a while. As of right now, the top 5 are;

1. LojaMac.com 4.34/10
2. PC Studio 4.27/10
3. ONO Tea 3.61/10
4. Hemvaruhuset.se 3.51/10
5. The Safari Clothing Store 3.42/10

Congratulations to these 5 outstanding shops!

I’m adding probably only 3 or 4 shops a week at the moment as the majority of shops that get listed are either Template Monster templates (see below) or standard osCommerce (perhaps with a few colour changes (again, see below).

So, please, if you know of an outstanding themed store, that is “more” than standard osCommerce and is not a Template monster, please add them to the Hot 100 list!

Template Monsters

These are fine looking shops – but don’t expect them to get on the list of the best 100. After all, who wants to see the same design over and over? If you spot a TM templated store on the list, which has got past me, please let me know?

Standard osCommerce

osCommerce is just fine out of the box – your site won’t look like 1000s of others, right? Please do not add a site unless it is “more” than osCommerce (just colour changes to the stylesheet is NOT enough).

How to create a HOT 100 site without buying a TM template!

Do you have a designers eye? Do you know PHP? Do you know a bit about how osCommerce hangs together? The answer is probably “no” or “yes, a bit”. Well, take my advice and read this post and this post, then decide if you have the knowledge to make something good…if not, suggest a design tutorial or someone makes you a uniquely designed osCommerce – both of which work out much better value than a TM template!

Show Firstname and Surname in osCommerce greeting

When an existing customer logs into your osCommerce shop, a nice little message is displayed, like this:

Welcome back John! Would you like to see which new products are available to purchase?

Obviously assumes that you have not removed or amended this message! In the osCommerce forum someone requested that the message show both firstname and surname, so here is how I would do it for maximum portability and compactness of code!

Open up login.php in your favourite text editor…

Find this:
[php]$check_customer_query = tep_db_query(“select customers_id, customers_firstname, customers_password, customers_email_address, customers_default_address_id from ” . TABLE_CUSTOMERS . ” where customers_email_address = ‘” . tep_db_input($email_address) . “‘”);[/php]

Change it to this:
[php]$check_customer_query = tep_db_query(“select customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id from ” . TABLE_CUSTOMERS . ” where customers_email_address = ‘” . tep_db_input($email_address) . “‘”);[/php]

Find this:
[php]$customer_first_name = $check_customer[‘customers_firstname’];[/php]

Change it to this:
[php]$customer_first_name = $check_customer[‘customers_firstname’] . ‘ ‘ . $check_customer[‘customers_lastname’];[/php]

Save the file and upload. If you are logged in, log out, and log back in. Firstname and surname now show in the greeting, as so;

Welcome back John doe! Would you like to see which new products are available to purchase?

Easy as 123.

Special Offer ending soon

All, the Special Offer I’ve been offering to clubosc readers is ending soon, end of this month. Please see here for more details of my osCommerce eBooks offer.

if you have any interest in learning how to make your osCommerce site better looking, consider buying before the Offer ends as it will save you at least $40!

Special Offer Pricing = £15 for desing oscommerce, free for oscommerce sts, free for oscommerce on localhost as opposed to £15, £15 and £5 !

Show Stock Availability in osCommerce Product Info

Dana asks;

Im trying to show the amount of items that I have available on each product page please help

This is an often asked question and is really simple to do. Open up product_info.php and add this code somewhere:

[php][/php]

This is a standard php function and will output (in numbers) the amount of product you have in stock. Couldn’t be easier really.

How to make this more friendly

How about having a series of messages showing availability rather than just numbers…one way to do this would be to make our own function which uses the existing tep_get_products_stock function and adds in a few pieces of php of our own…

Step 1 – the new function

So, open up /includes/functions/html_output.php and add this code:

[php]function clubosc_products_stock($pID) {
switch(tep_get_products_stock($pID)) {
case 10:
case 9:
case 8:
case 7:
case 6:
$in_stock = TEXT_LIMITED_AVAILABILITY;
break;
case 5:
case 4:
case 3:
case 3:
$in_stock = TEXT_VERY_LIMITED_AVAILABILITY;
break;
case 1:
$in_stock = TEXT_ULTRA_LIMITED_AVAILABILITY;
break;
default:
$in_stock = TEXT_UNLIMITED_AVAILABILITY;
}
return $in_stock;
}[/php]

What we have done here is create a NEW function called clubosc_products_stock – you could name this absolutely anything to suit your needs. This new function uses the existing function I already spoke of above, to get the number of products in stock. It then compares that number against a “case” and shows the relevant message! Easy as 123. No?

Basically the “case” is saying IF the number in stock EQUALS me, then show a message. In the example above, if the number in stock is 1, then the message TEXT_ULTRA_LIMITED_AVAILABILITY will show. If the number in stock is 2000, then TEXT_UNLIMITED_AVAILABILITY will show as the message.

Got it now?

Step 2 – language

Next up is to add those messages, so open up /includes/languages/{ your language }/product_info.php and add:

[php]define(‘TEXT_LIMITED_AVAILABILITY’, ‘We have a few in stock…’);
define(‘TEXT_VERY_LIMITED_AVAILABILITY’, ‘We have very few in stock…’);
define(‘TEXT_ULTRA_LIMITED_AVAILABILITY’, ‘Only 1 left, buy it now!’);
define(‘TEXT_UNLIMITED_AVAILABILITY’, ‘We have loads in stock…’);[/php]

Obviously repeat in each language that your shop uses.

Step 3 – add the function to the product page

Open up product_info.php and add this code somewhere:

[php][/php]

Save it all, reload your page, and see what shows. Easy as 123.

Change the SWITCH

So, let’s say you want to add a new message inside the switch, with a new message for stock between 15 and 11 items available. Easy, just add a new BLOCK of code inside the switch, like this:

[php]case 15:
case 14:
case 13:
case 12:
case 11:
$in_stock = TEXT_SORTOF_LIMITED_AVAILABILITY;
break;[/php]

And remember to also add the new language piece!

Show Images instead of Text

Easy enough, just create the images you need for each BLOCK of availability and set the image (instead oft ext) as the $in_stock – like this:

[php]$in_stock = tep_image(DIR_WS_IMAGES . ‘loads.gif’);[/php]

Have fun!

osCommerce v3 – released

Well almost 😉 Apparently v3.0 of osCommerce is near to release, here’s a paragraph from HPDL;

…look forward to making 2009 an even better year with osCommerce Online Merchant v3.0, with a production-ready release of the new core engine being made in February…

So, v3 should be out there, accessible by all, by the end of February. Which will be good as it’s been far too long since the last release of osCommerce.

However, don’t hold your breath! It’s well known that osCommerce has the slowest release cycle of almost any (large) open source project. This new version has been promised for YEARS, so I don’t really expect to see it within the next 6 weeks.

If I am wrong about that, and I hope I am, then great. Of course, a new release of osCommerce means more support work, updating my templates, updating my eBooks and all the rest of that gubbins. I’ll also need to make a new category in this blog just for v3 questions as there is going to be a lot of them, I suspect.

List of osCommerce Experts

Here is a list of people who I feel have enough about them to be considered “experts in osCommerce” – I have specifically excluded those people who know lots about osCommerce, but only run their own shops – in other words, all of the people listed below are “available for hire”. All of these people also post fairly regularly on the main, official, osCommerce Forum.

The list is in no particular order…

FWR Media (aka Rob)
osCommerce Forum Profile: # 68771
Website: FWR Media

FIMBLE (aka Nic)
osCommerce Forum Profile: # 15542
Website: www.linuxuk.co.uk

toyicebear (aka Nick)
osCommerce Forum Profile: # 36315
Website: www.activeebiz.com

burt (aka Gary)
osCommerce Forum Profile: # 69
Website: www.clubosc.com

Multimixer (aka George)
osCommerce Forum Profile: # 227413
Website: multimixer.gr

Dunweb (aka Chris)
osCommerce Forum Profile: # 211496
Website: dunwebcarts.com

There are more people out there who know about osCommerce, but these few are the ones that are still supporting the community as well as carrying on their business(es).

If you can support these people, then osCommerce will continue to thrive.

If you are an osCommerce developer/designer and wish to be added to this list, email me. You’ll need to be active in the osCommerce forum and have a good portfolio.

Split an image into the breadcrumb

“M” asks;

Is it possible to replace “Top” with an image, and not effect the rest of the breadcrumbs; I mean not cause the colored background increase in height. Rephrasing…is it possible to overlay and image, that would replace “Top” on the breadcrumb line so that I could surround the image in a matching square or circle background that would seemlesly merge with the background stripe of the breadcrumb background color.

and supplies an image;

This is fairly easy – in short you have to split the “i” image up into three parts;

1. the middle piece which is the same HEIGHT as the breadcrumb bar.
2. the top piece
3. the bottom piece

Then use CSS to place each piece appropriately in your design.

1. middle piece goes in the breadcrumb, then indent the text of the breadcrumb
2. top piece goes at the BOTTOM LEFT of the td ABOVE the breadcrumb
3. bottom piece goes at the TOP LEFT of the td BELOW the breadcrumb

Read more about CSS at w3schools.com.

Top:

Middle:

Bottom:

More Help

I show how to do something very similar in both of my “designing oscommerce” and “oscommerce sts” ebooks. In the designing one I show how to split up an image and use css to place it in a couple of areas, and in the sts book I show how to move the breadcrumb along to suit a design. More info on these eBooks by going to oscbooks.com – and if you buy one, you get the other FREE.

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 ^

Show Products Ordered on Order Summary

Yesterday an osCommerce client of mine asked me to come up with some code for showing what the person had ordered WITHOUT having to click on the individual orders…

So, I set to thinking and came up with the idea of showing the products ordered in the orders.php page. So, instead of seeing a normal orders summary like this:

An extra column is added to show the products ordered, and the quantity thereof, as so:

After some twiddling with the codebase, it turned out fairly decently I think.

Remember…

1. Make the SHOP side as easy as possible for your customers to use
2. Maker the ADMIN side as easy as possible for YOU to use

Product Weight By Attribute

Theresa asks;

We have products on os commerce that are sold in two different weights. As the product attribute only has a field for one weight, how can we add the variation in weights so that shipping costs are calculated properly?

Assuming you are using the product attributes to differentiate between your product sizes/dimensions, there is a contribution that adds weight to attributes. This makes it very simple to do something like:

Product A (1kg)
– small (no extra weight)
– large (extra weight of 0.5kg [or whatever])

Link: http://www.oscommerce.com/community/contributions,1622

The extra weight is then parsed as normal via the shipping modules and the correct fee should be charged…

That should just about do it, shouldn’t it?