Add an icon to shipping quotes in osCommerce
This is a super simple little modification that you can use to draw attention to your preferred method of shipping...
What we are going to do is add an icon to the "flat rate" quote, so that instead of looking like this:

It will look like this:

Step 1: Make your icon
This is easy enough - just make or acquire an icon. In the example above I used a "star" image, but you could use any image you wish.
Step 2: Upload your icon
The icon you made should be uploaded into your "icons" directory which is inside your "images" directory. It's important to remember what you called the icon - I called mine star.jpg
Step 3: Code changes
Open up /includes/modules/shipping/flat.php and find this line of code:
-
$this->icon = '';
Change it to:
-
$this->icon = DIR_WS_ICONS . 'name_of_your_file';
In my example, I had to change it to:
-
$this->icon = DIR_WS_ICONS . 'star.jpg';
Save the file and upload. All being well, your image should now show. Easy as 123.
A little explanation of the line of code...
-
$this->icon = DIR_WS_ICONS . 'star.jpg';
We are simply telling the software to look inside DIR_WS_ICONS (/images/icons/) for a file called star.jpg - and assign the image to $this->icon
Later on in the flat.php file, $this->icon is used to show the image...
-
if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);
Which might not make any sense to you, but that doesn't matter. All you need to know is that if you did everything correctly, your image file will show up.
You can make this same change to any of your shipping methods - eg, you might use "Royal Mail Special Delivery" so you might want the SD logo. Have fun!



This is a neat idea.
Thanks again for the wonderful ideas and how to do them
Comment by cassie — July 30, 2008 @ 6:11 am
Cassie - thanks for your kind words
Comment by Gary — July 30, 2008 @ 9:57 pm