Updated for ’08 – Make Your osCommerce Faster

I just finished up the next osC Book update – ‘How To Make Your osCommerce Faster‘ – in this eBook I show a number of methods that will speed up your osCommerce store.

speed_up_oscommerce.jpgSome of the changes are very simple, some are more advanced. This morning, I installed a brand new osCommerce RC2 and managed to get the page load time down from 1.375 seconds to 0.563 seconds with just a few cut and paste changes and a couple of Admin changes – that’s a page load speed decrease of just about 59% – and that is on a standard installation of osCommerce – if you have a larger osCommerce store, you should see even more startling results!

In addition to the excellent speed increase, the changes mean less calls to the MySQL database which is always a good thing.

The contents of the eBook is very easy to follow and I can say for sure, that even if you only make a couple of the changes in the eBook, your store will run faster and smoother.

So, if you want to make your osCommerce speedier – and therefore more pleasing to your potential buyers, have a think about purchasing the eBook – you might just learn something you didn’t know before.

And the price is set at just £3.99 (about $7) – not too much to pay for a more pleasing website I’d say.  www.oscbooks.com

Adding un-necessary bells and whistles

Flash intros rock. Add two of them, and make sure you don’t put one of those annoying ‘Skip intro’ links at the bottom. Heck, if you did that nobody would see Uncle Joe’s mediocre flash skills.

Then, when you finally let the three customers who are willing to sit through your crappy intro into your store, make sure you have a flash product menu, a flash header, and random flash buttons all over the page. Page animations and moving text = Quality and usability, and don’t you ever forget it.

Don’t worry- if that doesn’t slow your site down to a crawl you can always add Java. Sure, most professional developers and customers alike refer to Java as ‘That F&%@*$# Java!?’, but your customers are different. Put random Java image switchers on every page. Put that neat-o Java water ripple effect thingy on your homepage, because that wasn’t old and tired in 1993.

And make sure you require Java along with Flash and Windows Media Player and QuickTime and Comet Cursor to use your site properly. Maybe throw in an ActiveX dialer installer just for good measure- Customers love compulsory ad ware laden downloads and plugins while trying to spend their money on your products!

If you didn’t get the sarcasm in the above, then it might just be that your site needs a makeover and quickly.

Flash, Java, and all that other ‘stuff that moves’ has no place on a productive website. Adding a flash intro only adds another layer of ‘junk’ between the customer and the product info page where the action happens.

Flash headers only make low bandwidth connections slower to your site. Java image switchers literally crash half the browsers on the planet, and moving junk all over your site makes it look like some MySpace homepage.

Look at your 10 favorite shopping sites online. Count how many moving, annoying things they have blinking and flashing and scrolling around. Now look at yours. You might want to reassess if that neat Flash header with the annoying SWOOOOSH! noise every time a page is loaded is really worth it.

The whole point of owning an e-commerce site is to get customers to your product pages as quickly as possible – and then have them click that all important “BUY” button. Anything, and I mean ANYTHING that you put in the way of that is only going to hurt your bottom line.

This post is courtesy of my good friend Jason over at JC Commerce.

Selling Event Tickets via osCommerce

Wil asks;

A customer would like to offer entry vouchers for events. Each voucher needs to have a unique ID so that they can be checked and redeemed at entry. Ideally a PDF file created automatically with for each on-line voucher and either emailed to the customer after purchase through paypal or a download area for a few days. Customer needs to be able to print off vouchers on their home pc.

I don’t see any particular problem with this. What you need is to make a “product” which at the end of the checkout process will create a fancy looking PDF along with the unique ID.

It is certainly do-able with osCommerce, but I think it would invovle a bit of custom coding – but then that would be true for whichever cart system you decided to use.

You’d need to have some sort of process to give each PDF a unique ID – would you have some ID’s in a database table maybe, and give the customer the next available ID? Or maybe it would be randomly created?

I think, not a lot of work, but it would need serious thinking about in order to get the process correct. Making a PDF file is quite easy! Getting the ID onto that PDF file is realtively easy! Getting the PDf linked to the checkout process is pretty easy! So it coulds rather easy, but I know in practice, it’s going to be a fair amount of work.

Does this help, at all? Or have I confused you further?

I think that for someone new to osCommerce, it’d be a step too far to try to code this up – I’d suggest that you need to get a “pro” on it. Sounds like an interesting project!

New Look for Site

Since I started the site in 2004, I’ve stuck with the same design until the last few weeks. The old design served it’s purpose fairly well, but was getting stale.

4 years, in internet terms is a VERY long time – so I decided that a “more modern” look was needed. After a bit of brain-storming I came up with the new look which is more of a “blog” layout than a “typical website” layout – although the site is not a blog.

I think the site is much easier to navigate now, and in my opinion it’s certainly more modern looking. Here’s a comment from a friend;

I always thought the old design was a bit ugly

A New Logo!

oscbooks_dk_gif.gif

Which gives a bit more “modern” look again. What do you think?

Here’s the site, and yes, I still have the “Buy One Get One Free” offer running: http://www.oscbooks.com

I need a designer

Mike asks;

I need someone to design a template. Any recommendations?

It’s pretty much possible to do anything in osCommerce, if the developer has enough skills – but there are not many osCommerce developers who are also great at design. It’s the old “left brain / right brain” scenario – so my suggestion would be to find a website design outfit who can make a site look to your specification. Get them to supply you with the design, 1 HTML page and the sliced graphics.

It would then be quite straightforward for a good osC developer to integrate the design – or you could even integrate it yourself (have a look at this eBook).

I like the designs that come from these guys. I don’t know how well up they are in terms of knowing osCommerce inside out, but that’s not a problem – so long as they can come up with a design to suit your needs, it’s relatively easy to find someone “osc experienced”…

Also, have a read of this post which I made the other day, as that might give some other ideas…I guess it’s a matter of economics – if you have the budget, go with a designer to design and a developer to integrate to osCommerce. If the budget is not so great, how about a pre-made HTML template from the likes of Template Kingdom and then integrate yourself.

Of course, I take the odd design job myself, but my ethos these days is in building accessible sites rather than “pretty” sites – it’s my belief that websites should be useable and accessible rather than pretty. Here’s a screenshot of the site I am working on right now;

now.gif

As you can see, not particularly pretty, but a bit more usable than normal osCommerce.

Reversing the order of the cart contents

In the osCommerce forum, someone posed an interesting question;

does anyone know how to reverse the order of the shopping cart dsiplay so that new products added will go onto the top of the list rather than the bottom.

Having thought about the question for a minute or two, this actually makes perfect sense and makes any shop more useable in my opinion. After all, if a customer has 20 items in their cart, it makes sense not to make them scroll to see the last item added.

So, how to do this?

The user in the osCommerce forum posted some code she had made – but it was problematic – and it’s no point posting broken code here. My solution is ALWAYS to go for the easiest way to do something…

Open up /includes/classes/shopping_cart.php and find;

[php]return $products_array;[/php]

Change it to;

[php]return array_reverse($products_array);[/php]

Save the file, upload and test your new look shopping cart 😉

REMEMBER: always try to do things the easiest way possible. If you make things easy, it’s just as easy to go back to standard osCommerce when (if) it all goes wrong!

Did this help you? Feel free to buy me a beer 😉

Make a NEW featured product box

Mark asks;

how would i go about re-coding [your featured product contribution] to keep the “new products for…” feature [and have the featured products in their own box]?

Step 1: Rename the module (new_products.php) in the zip to “featured_products.php”

Step 1a: Change the line of code in module “featured_products.php” from this;

[php]$new_products_query = tep_db_query(“select p.products_featured, p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, if(s.status, s.specials_new_products_price, p.products_price) as products_price from ” . TABLE_PRODUCTS . ” p left join ” . TABLE_SPECIALS . ” s on p.products_id = s.products_id, ” . TABLE_PRODUCTS_DESCRIPTION . ” pd where p.products_status = ‘1’ and p.products_id = pd.products_id and pd.language_id = ‘” . (int)$languages_id . “‘ order by p.products_featured DESC, p.products_date_added desc limit ” . MAX_DISPLAY_NEW_PRODUCTS);[/php]

to this:

[php]$new_products_query = tep_db_query(“select p.products_featured, p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, if(s.status, s.specials_new_products_price, p.products_price) as products_price from ” . TABLE_PRODUCTS . ” p left join ” . TABLE_SPECIALS . ” s on p.products_id = s.products_id, ” . TABLE_PRODUCTS_DESCRIPTION . ” pd where p.products_featured = ‘1’ AND p.products_status = ‘1’ and p.products_id = pd.products_id and pd.language_id = ‘” . (int)$languages_id . “‘ order by p.products_featured DESC, p.products_date_added desc limit ” . MAX_DISPLAY_NEW_PRODUCTS);[/php]

Step 1b: Change code in the same file from this:

[php]TABLE_HEADING_NEW_PRODUCTS, strftime(‘%B’)[/php]

to this:

[php]TABLE_HEADING_FEATURED_PRODUCTS[/php]

Step 1c: Add this code into /includes/languages/english/index.php

[php]define(‘TABLE_HEADING_FEATURED_PRODUCTS’, ‘Featured Products’);[/php]

Step 2: Install the contribution which you have amended in Step 1, 1a, 1b and 1c!

Step 3: In index.php, add this code;

[php] 0) { ?>

[/php]

Step 4: In /includes/functions/general.php add this extra code;

[php]function tep_count_featured_products() {
$featured_query = tep_db_query(“select count(*) as total from ” . TABLE_PRODUCTS . ” where products_featured = ‘1’”);
$featured = tep_db_fetch_array($featured_query);
return $featured[‘total’];
}[/php]

Step 5: If you get it working following the instructions above, Buy Me A Beer, I like beer 😉 !

If you cannot get it working, I offer an install service – please email me on oscshops@gmail.com

Gary

Help! Attributes, Templates, Stylesheet

Maureen asks;

I have a sign and apparel shop, we sell tshirts and would like to do some interactive designs online. I can’t seem to find a good contribution to make this change within osc.

OK, I’m guessing that you are trying to use the “products attributes” and you want to change the image of a product when a different attribute is selected? If so, take a look at; http://addons.oscommerce.com/info/5456 – I have not tested or even used that addon, but it looks OK to me.

Second I’m not sure how to even go about downloading and uploading a template when I do find one.

Once you find a template, you’ll need to follow the instructions. You need to note that applying a template should be done as the very first thing after an install otherwise any changes you make might knock the template off base…

Hopefully the template provider has just provided changed files rather than a whole oscommerce install! If you can, avoid the “osCommerce Templates” from the likes of Template Monster – they are good looking, but poorly coded.

Third, yes there is a third, I read about changing colors for the shop but can only seem to change the background color. I’ve been reading for weeks about ‘how to change colors’ and it doesn’t seem to work for whatever reason. One day I can change lets say the background but nothing else will change. Even when I go through every option there is.

Everything that you’ll need to change would be in the stylesheet.css file – but as osCommerce was coded so long ago (the year 2000) the files and stylesheet are kind of outdated. So you have lots of redundant code in them.

The easiest way is to open up an osCommerce page, then do “view source”. Find the area that you wish to change the look of and then work your way backwards to find the “class” that is applied to it.

As an example, let’s say you wanted to change the footer area where it says “158 requests since Monday 07 April, 2008”, I’d open up the source and find it;

[php]

158 requests since Monday 07 April, 2008

[/php]

You can see that the nearest “class” before it is `footer`, so then you find this in the stylesheet.css file and change it. Hope this makes sense?

I’d also advise you to have a think about getting your hands on a tutorial – this will help you to really get up to speed with osCommerce really quickly. My own tutorial on “How To Design osCommerce” is a good read, well worth the small cost to save banging your head on the keyboard.

Gary

Error -12263 in osCommerce

Been seeing lots and lots of this error crop up recently in the osCommerce Forums.  I also had a client with this exact same problem…

After a bit of investigation, the problem is that your /includes/configure.php file is calling resources from a SSL that does not exist.

Example;  www.yoursite.com and https://yoursite.com – but you have not yet set up https on your domain.

Solution:  stop using SSL connections until you have it set up!

How Much Should I Pay?

Randy asks

Hi, I want to have a nice looking website, I don’t know how much I should pay for a nice design. I have 3 quotes for a design ranging from $99 ! to over $1000 – for much the same thing. Any advice would be great.

Randy, what you are asking is “how long is a piece of string”. As an example, you could buy a template from the likes of Template Monster, then ask 20 different designers to quote for integration to osCommerce – and I guarantee that those quotes will be entirely different.

My advice is as follows;

add up the total of your quotes, then divide by the number of quotes you have. This will give you your median quote figure. Go for the quote which is nearest to that median figure.

This *should* give you the best of the designers ability and the price point. It’s not an exact science though! Ask to see the designers previous work with osCommerce. He should be happy to show you at least a few stores!

Let’s look at some pricing;

Stylesheet Changes – getting someone to install osCommerce and make a few stylesheet changes – this is no more than 1 or 2 hours of work, so you should be looking at paying no more than £50 – £100 (about $100 to $200). Maybe even less. A good developer who knows osCommerce should be able to do this in less than 15 minutes – but I expect he or she would charge for at least 30 minutes of work.

HTML Template Integration – getting a developer to integrate a “Template Monster” – this should cost between £200 and £400 – about $400 to $800. Depending upon the complexity of the design the price will be towards the higher end of the scale. If you need extra coded bits to suit the design, expect to pay more.

CAVEAT: Watch out for the “osCommerce Templates” from the likes of Template Monster – they are usually coded very poorly and they have non-existant support – hence the high number of “I’ve bought a Template Monster and it doesn’t work” threads in the official osCommerce Forum.

Bespoke Design – getting a developer/designer to make a design just for you – the best way to get a one-off look to your store. Expect to pay at least £750 (to £2000) for the design and another £300 for the integration. The good thing is that most osCommerce developers will know what osCommerce is capable of and will adjust their design accordingly.

osCommerce Template – buying an “off the shelf” template for osCommerce – possibly the easiest way to get a good look and pay only a tiny amount for it. This is NOT the same as buying an osCommerce template from the likes of Template Monster. You would be dealing with an osCommerce expert, not a bunch of no-marks. A decent osCommerce template bought from an expert will cost you between £50 and £100 ($100 to $200) usually. You get support within the price!

My advice;

If you have the cash, go for a bespoke design, made by a true osCommerce developer/designer. I can list some names of such people (there are not many) if this would help.

If you don’t have the cash, go for an osCommerce Template from someone who knows osCommerce inside out. This would be a good base for making further changes to make the site your own.

In other words, deal with osCommerce experts and you won’t go far wrong.

Any help to you?