How To Change osCommerce Store Logo

osCommerce is not a true CMS, it is just pretty good old shopping cart. And this lack of CMS features let osCommerce users down when it comes to do some simple changes as changing osCommerce store logo.

There are few simple solutions to change store logo, well basically there are just 2 ways.

These solutions are for osCommerce Online Merchant v2.3.1 but they will equally work with older versions too, specially the 2nd solution described below.

1) Change osCommerce store logo from the osCommerce admin

This is simplest way and you don’t have to mess with the php code.

Visit your osCommerce store’s Admin-> Configuration-> Store Logo and upload your own logo.

osCommerce - Change Store Logo from Admin
osCommerce – Change Store Logo from Admin

Pretty simple! huh! not so.

Problem No. 1 : If your logo is not the same size as osCommerce’s logo then it will not fit properly in the header and you will end up in changing the css styles

Problem No. 2: It allows only .png file extension. Sounds primitive isn’t it?

Problem No. 3: It will always save the logo with store_logo.png file name. Again a primitive approach.

So what is the ultimate method to change the osCommerce store logo? Well, as usual, mess with punch of php code as described below.

2) Change osCommerce store logo in header.php file

Open /includes/header.php file in any html editor or plain text editor and search for the following line. It will be on line no. 19

[sourcecode language=”php”]<?php //echo ‘<a href="’ . tep_href_link(FILENAME_DEFAULT) . ‘">’ . tep_image(DIR_WS_IMAGES . ‘store_logo.png’, STORE_NAME) . ‘</a>’; ?>[/sourcecode]

Comment the code as below and change it to use your logo.

[sourcecode language=”php”]<?php //echo ‘<a href="’ . tep_href_link(FILENAME_DEFAULT) . ‘">’ . tep_image(DIR_WS_IMAGES . ‘store_logo.png’, STORE_NAME) . ‘</a>’; ?>
<a href="/"><img title="My Store Name" src="/images/mylogo.png" alt="My Store Name" width="120" height="60" /></a><a href="/">[/sourcecode]

With this method you have flexibility to use any image type which you wish.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *