Remove a Table – Best Sellers InfoBox

Here is an easy way to remove a table without any unwanted side effects. Open up /includes/boxes/best_sellers.php and find:

[php]$rows = 0;
$bestsellers_list = ‘

‘;
while ($best_sellers = tep_db_fetch_array($best_sellers_query)) {
$rows++;
$bestsellers_list .= ‘

‘;
}
$bestsellers_list .= ‘

‘ . tep_row_number_format($rows) . ‘. ‘ . $best_sellers[‘products_name’] . ‘

‘;

$info_box_contents = array();
$info_box_contents[] = array(‘text’ => $bestsellers_list);[/php]

Change it to:

[php]$rows = 0;
$bestsellers_list = ”;
while ($best_sellers = tep_db_fetch_array($best_sellers_query)) {
$rows++;
$bestsellers_list .= tep_row_number_format($rows) . ‘. ‘ . $best_sellers[‘products_name’] . ‘
‘;
}

$info_box_contents = array();
$info_box_contents[] = array(‘text’ => $bestsellers_list);

new infoBox($info_box_contents);[/php]

If you wanted, you could also remove the tep_row_number_format function. All this does is create a number from 1 to 10 for each seller. If you wanted to do this, try the following code instead;

[php]$rows = 0;
$bestsellers_list = ‘

    ‘;
    while ($best_sellers = tep_db_fetch_array($best_sellers_query)) {
    $rows++;
    $bestsellers_list .= ‘

  1. ‘ . $best_sellers[‘products_name’] . ‘
  2. ‘;
    }
    $bestsellers_list .= ‘

‘;

$info_box_contents = array();
$info_box_contents[] = array(‘text’ => $bestsellers_list);[/php]

Which would output a semantically correct numbered list instead.

Leave a Reply

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