Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

bestsellers page


rockstar_clothing

Recommended Posts

Hi,

 

Wasnt sure where to put this post but here goes anyway.

 

I want to use the bestsellers page contrib so I can have a page of bestsellers instead of the info box.

 

Trouble is its set to display in a single column going down the page. I want to have two columns but have so far been unable to do it.

 

Hope someone can help??

 

Thanks,

 

Adam

Link to comment
Share on other sites

I use 3 colums here: http://www.painted4kids.com/bestsellers.php

 

I changed the code posted to show 2 colums for you.

 

HTH

Monika

 

      <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
<?php
   $row = 0;
   $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);

 $counter = 0;

   while ($best_sellers = tep_db_fetch_array($best_sellers_query)) {
     $row++;

     $counter++;
     if (strlen($counter) < 1) {
       $counter = '0' . $counter;
     }

    $best_sellers['specials_new_products_price'] = tep_get_products_special_price($best_sellers['products_id']);

   if (tep_not_null($best_sellers['specials_new_products_price'])) {
     $price = '<s>' . $currencies->display_price($best_sellers['products_price'], tep_get_tax_rate($best_sellers['products_tax_class_id'])) . '</s><br>';
     $price .= '<span class="productSpecialPrice">' . $currencies->display_price($best_sellers['specials_new_products_price'], tep_get_tax_rate($best_sellers['products_tax_class_id'])) . '</span>';
   } else {
     $price = $currencies->display_price($best_sellers['products_price'], tep_get_tax_rate($best_sellers['products_tax_class_id']));
   }

     echo '            <td align="center" width="50%" class="smallText" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $best_sellers['products_image'], $best_sellers['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']) . '">' . $counter . '. ' . $best_sellers['products_name'] . '</a><br>' . $price . '</td>' . "\n";

     if ((($row / 2) == floor($row / 2))) {
?>
         </tr>
         <tr>
           <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
         </tr>
         <tr>
<?php
     }
   }
?>
         </tr>
       </table></td>
     </tr>

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...