Contributions

InfoBoxes (Category Index)
Search: 

Remove Zeros Bestsellers

This contrib shows you how to remove the zeros from the bestsellers infobox so that the bestsellers are numbered as...

1.
2.
3.

Instead of the default

01.
02.
03.

This is a simple conribution that requires no file downloads. it jsut requires a simple change to your general.php file.

===================
Intructions:

Step 1.

Open the file /catalog/includes/functions/general.php

Step 2.

In your general.php file go to this line (it is line # 579 in my file but I have a heavily modded store)...

function tep_row_number_format($number) {
if ( ($number < 10) && (substr($number, 0, 1) != '0') ) $number = '0' . $number;

Step 3.

Change the code above to this...

function tep_row_number_format($number) {
if ( ($number < 10) && (substr($number, 1) != '0') ) $number = '0' . $number;

Step 4.

There is no step #4...YOU'RE DONE!!!

Disclaimer: I have no idea if this change messes up any other processes but so far it is working for me with no problems.

Expand All / Collapse All

A different solution G Burton 21 Nov 2004

A different (and IMO superior) solution to remove preceeding zero's. Uses semantic HTML (ordered list), thus the list can now be styled using .css [ see http://www.w3schools.com/css/tryit.asp?filename=trycss_list-style-type2 ]

Replace the file /includes/boxes/best_sellers.php with the one in this .zip file.

Remove Zeros Bestsellers Collin X Martinez 7 Nov 2004

Note: Contributions are used at own risk.