Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help to make some changes


ovejohnsen

Recommended Posts

Hi

 

im working on putting up my web shop

and i want to put a best sellers script on the index page.

in the field where you put in your own text just above the new products.

i want to have a box like the new products just with the 10 best sellers.

 

 

so the set up would be like this

 

welcome to shop name

 

topp 10 best sellers box

 

new produkts box

 

the set up shuld be like the new produkt box, with picture and name and prices underneath.

 

 

is there anyone that can helpe me with this??

 

 

Regards Ove

Edited by ovejohnsen
Link to comment
Share on other sites

Try the scrolling bestsellers box. You can control how many are displayed and whether or not it scrolls.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Try the scrolling bestsellers box. You can control how many are displayed and whether or not it scrolls.

 

Jack

 

It reports an error when i post it in.

 

this is how fare i got. im getting the products on the page but it's displaying the price as 0 and its not getting the pictures.

 

some helpe please.

 

<?php
/*
 $Id: best_sellers.php,v 1.34 2003/06/09 22:49:58 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
?>

<!-- best_sellers //-->
<?php
 $info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_BESTSELLERS);

 new contentBoxHeading($info_box_contents);


 if (isset($current_category_id) && ($current_category_id > 0)) {
$best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id) order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
 } else {
$best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name 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);
 }


 $row = 0;
 $col = 0;
 $info_box_contents = array();
 while ($best_sellers = tep_db_fetch_array($best_sellers_query)) {
$best_sellers['products_name'] = tep_get_products_name($best_sellers['products_id']);
$info_box_contents[$row][$col] = array('align' => 'center',
									   'params' => 'class="smallText" width="33%" valign="top"',
									   'text' => '<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']) . '">' . $best_sellers['products_name'] . '</a><br>' . $currencies->display_price($best_sellers['products_price'], tep_get_tax_rate($best_sellers['products_tax_class_id'])));

$col ++;
if ($col > 2) {
  $col = 0;
  $row ++;
}
 }

 new contentBox($info_box_contents);
?>
<!-- best_sellers_eof //-->

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...