Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Indenting and 1 not 01


david

Recommended Posts

Hi

 

Is it possible to change the 01, 02 etc. to just 1, 2 in the best sellers box?

 

Also, how does one indent the second line when the length of the best seller is forced onto a second line.

 

thx

 

david

Link to comment
Share on other sites

If you look at the code in /includes/boxes/best_sellers.php it is the format used:

 

    while ($best_sellers = tep_db_fetch_array($best_sellers_query)) {

     $rows++;

     $info_box_contents[] = array('align' => 'left',

                                  'text'  => tep_row_number_format($rows) . '. <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id'], 'NONSSL') . '">' . $best_sellers['products_name'] . '</a>');

   }

 

Take away the format, which is defined in /includes/functions/general.php and you should get the numbers without the leading 0 on them.

 

Don't remove the function itself from general.php as that is used elsewhere, but remove the use of it in best_sellers.php

Link to comment
Share on other sites

You could do this with tables.

 

Look at how /includes/boxes/best_sellers.php is built.

 

Put the number in a <td>##</td><td>product name</td>

 

You are mainly editing this line:

 

                                   'text'  => tep_row_number_format($rows) . '. <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id'], 'NONSSL') . '">' . $best_sellers['products_name'] . '</a>');

 

You do not want the tep_row_number_format($rows) as that is giving you the 01, 02, 03 ... you just want $rows

 

To utilize the indented look ... via <td> settings.

 

Change it to:

                                   'text'  => $rows . '.' . '</td><td align="left" valign="top" class="boxText">' . '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id'], 'NONSSL') . '">' . $best_sellers['products_name'] . '</a>');

 

This should give you the look you want.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...