Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Enhanced BestSeller box with admin


Guest

Recommended Posts

I see that i am the only one that cant install it!!!

My admin options are ok and i have checked 10 items... but nothing shows in the site... are these instructions correct? Please help...

 

The site is http://www.intersound.gr/eshop (i am still testing it), i want to do something like the best sellers in http://www.studiosound.gr

 

ps

 

Do you know how did he put the rolling bar?

 

Step 3:

Add the following line to /catalog/admin/includes/filenames.php

 

#ADD:

define('FILENAME_BESTSELLERS2', 'bestseller2.php');

define('FILENAME_BESTSELLER', 'bestseller2.php');

 

 

Step 4:

Add the following line to /catalog/admin/includes/database_tables.php

 

#ADD:

define('TABLE_BESTSELLER', 'bestseller');

 

 

Step 5:

Add the following line to /catalog/admin/includes/boxes/catalog.php, right before the line that contains

<a href="'. tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a>');

 

 

#ADD:

'<a href="' . tep_href_link(FILENAME_BESTSELLERS2, '', 'NONSSL') . '" class="menuBoxContentLink">' . 'Best Sellers' . '</a><br>');

 

##Also, be sure to replace:

 

<a href="'. tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a>');

 

##With:

 

<a href="'. tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a>' .

 

Step 6:

Add the following lines to /catalog/includes/filenames.php

 

define('FILENAME_BESTSELLERS2', 'bestseller2.php');

define('FILENAME_BESTSELLER', 'bestseller2.php');

 

Step 7:

Add the following lines to /catalog/includes/database_tables.php

 

define('TABLE_BESTSELLER', 'bestseller');

 

Step 8:

In /catalog/includes/application_top.php, insert the following lines right after the line that contains

 

tep_expire_specials();

 

#ADD:

// auto expire bestseller products

require(DIR_WS_FUNCTIONS . 'bestseller2.php');

tep_expire_bestseller();

Link to comment
Share on other sites

  • 4 weeks later...
  • Replies 55
  • Created
  • Last Reply

I deleted all my bestsellers, and now i recieve the following error when clicking on bestseller2 link from admin:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-12, 12' at line 1

 

select p.products_id, pd.products_name, s.bestseller_id, s.bestseller_date_added, s.bestseller_last_modified, s.expires_date, s.date_status_change, s.status from products p, bestseller s, products_description pd where p.products_id = pd.products_id and pd.language_id = '4' and p.products_id = s.products_id order by pd.products_name limit -12, 12

 

[TEP STOP]

I would like to add new bestsellers now but i cant.

Any ideas anyone?

Thanks.

Link to comment
Share on other sites

ok, i solved this issue by replacing:

$offset = ($max_rows_per_page * ($current_page_number - 1));

$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

with:

$offset = ($max_rows_per_page * ($current_page_number - 1));

if ($offset < 0)

{

$offset = 0 ;

}

$sql_query .= " limit " . $offset . ", " . $max_rows_per_page;

in admin/includes/classes/split_page_results.php

it appears a bug:

http://www.oscommerce.com/community/bugs,1605

Link to comment
Share on other sites

  • 3 weeks later...

I have a problem in that the new BestSellers box does not have the drop shadows from a prior contribution. I believe the problem lies in Boxes.php but I dont yet have an answer. Any suggestions would be apprieciated.

 

<?php
/*
 $Id: boxes.php,v 1.2 2004/08/25 22:40:04 akhan Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 class tableBox {
var $table_border = '0';
var $table_width = '100%';
var $table_cellspacing = '0';
var $table_cellpadding = '2';
var $table_parameters = '';
var $table_row_parameters = '';
var $table_data_parameters = '';

// class constructor
function tableBox($contents, $direct_output = false) {
  $tableBox_string = '<table border="' . tep_output_string($this->table_border) . '" width="' . tep_output_string($this->table_width) . '" cellspacing="' . tep_output_string($this->table_cellspacing) . '" cellpadding="' . tep_output_string($this->table_cellpadding) . '"';
  if (tep_not_null($this->table_parameters)) $tableBox_string .= ' ' . $this->table_parameters;
  $tableBox_string .= '>' . "\n";

  for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
	if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= $contents[$i]['form'] . "\n";
	$tableBox_string .= '  <tr';
	if (tep_not_null($this->table_row_parameters)) $tableBox_string .= ' ' . $this->table_row_parameters;
	if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) $tableBox_string .= ' ' . $contents[$i]['params'];
	$tableBox_string .= '>' . "\n";

	if (isset($contents[$i][0]) && is_array($contents[$i][0])) {
	  for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) {
		if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) {
		  $tableBox_string .= '	<td';
		  if (isset($contents[$i][$x]['align']) && tep_not_null($contents[$i][$x]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i][$x]['align']) . '"';
		  if (isset($contents[$i][$x]['params']) && tep_not_null($contents[$i][$x]['params'])) {
			$tableBox_string .= ' ' . $contents[$i][$x]['params'];
		  } elseif (tep_not_null($this->table_data_parameters)) {
			$tableBox_string .= ' ' . $this->table_data_parameters;
		  }
		  $tableBox_string .= '>';
		  if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= $contents[$i][$x]['form'];
		  $tableBox_string .= $contents[$i][$x]['text'];
		  if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $tableBox_string .= '</form>';
		  $tableBox_string .= '</td>   ' . "\n";
		}
	  }
	} else {
	  $tableBox_string .= '	<td';
	  if (isset($contents[$i]['align']) && tep_not_null($contents[$i]['align'])) $tableBox_string .= ' align="' . tep_output_string($contents[$i]['align']) . '"';
	  if (isset($contents[$i]['params']) && tep_not_null($contents[$i]['params'])) {
		$tableBox_string .= ' ' . $contents[$i]['params'];
	  } elseif (tep_not_null($this->table_data_parameters)) {
		$tableBox_string .= ' ' . $this->table_data_parameters;
	  }
	  $tableBox_string .= '>' . $contents[$i]['text'] . '</td>' . "\n";
	}

  /* Jeff Limb's drop shadow mod version 1 */
  /* drop shadow mod */
  if ($this->table_parameters == 'class="infoBox"') {
  $tableBox_string .= '
  <TD width=7 vAlign=top background=images/dropshadow_right.jpg ></TD>
  ' . "\n";
  } elseif ($this->table_parameters == 'class="infoBoxHeading"') {
  $tableBox_string .= '
  <TD width=7 vAlign=top background=images/dropshadow_right.jpg ><IMG height=7 src="images/dropshadow_topright.jpg" width=7></TD>
  ' . "\n";
  }
  /*end drop shadow mod */

	$tableBox_string .= ' 		</tr>' . "\n";

	if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $tableBox_string .= '</form>' . "\n";
  }


  /* drop shadow mod */
  if ($this->table_parameters == 'class="infoBox"') {
  $tableBox_string .= '
  <TR><TD height=7 background=images/dropshadow_bottom.jpg><IMG height=7 src="images/dropshadow_bottomleft.jpg" width=7></TD><TD><IMG height=7 src="images/dropshadow_bottomright.jpg" width=7></TD></TR>
  ' . "\n";
  }
  /*end drop shadow mod */

  $tableBox_string .= '
  </table>' . "\n";

  if ($direct_output == true) echo $tableBox_string;

  return $tableBox_string;
}
 }

 class infoBox extends tableBox {
function infoBox($contents) {
  $info_box_contents = array();
  $info_box_contents[] = array('text' => $this->infoBoxContents($contents));
  $this->table_cellpadding = '0'; /* drop shadow mod necessary to change cellpading in infobox from 1 to 0 */
  $this->table_parameters = 'class="infoBox"';
  $this->tableBox($info_box_contents, true);
}

function infoBoxContents($contents) {
  $this->table_cellpadding = '3';
  $this->table_parameters = 'class="infoBoxContents"';
  $info_box_contents = array();
  $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
  for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
	$info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''),
									   'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''),
									   'params' => 'class="boxText"',
									   'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : '')));
  }
  $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
  return $this->tableBox($info_box_contents);
}
 }
//***********start best seller contribution************************//
class infoBox5 extends tableBox {
function infoBox5($contents) {
  $info_box_contents = array();
  $info_box_contents[] = array('text' => '<marquee id="marquee1" onMouseOver="marquee1.stop();" onMouseOut="marquee1.start()" bgcolor="#FFFFFF" direction="up" scrollAmount="1" style="height:80">' . $this->infoBoxContents($contents) . '</marquee>');
  $this->table_cellpadding = '1';
  $this->table_parameters = 'class="infoBox"';
  $this->tableBox($info_box_contents, true);
}

function infoBoxContents($contents) {
  $this->table_cellpadding = '3';
  $this->table_parameters = 'class="infoBoxContents"';
  $info_box_contents = array();
  $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
  for ($i=0; $i<sizeof($contents); $i++) {
	$info_box_contents[] = array(array('align' => $contents[$i]['align'], 'form' => $contents[$i]['form'], 'params' => 'class="boxText"', 'text' => $contents[$i]['text']));
  }
  $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
  return $this->tableBox($info_box_contents);
}
 }
//**********End of Contribution ********************//
 class infoBoxHeading extends tableBox {
function infoBoxHeading($contents, $left_corner = true, $right_corner = true, $right_arrow = false) {
  $this->table_cellpadding = '0';

  if ($left_corner == true) {
	$left_corner = tep_image(DIR_WS_IMAGES . 'infobox/corner_left.gif');
  } else {
	$left_corner = tep_image(DIR_WS_IMAGES . 'infobox/corner_right_left.gif');
  }
  if ($right_arrow == true) {
	$right_arrow = '<a href="' . $right_arrow . '">' . tep_image(DIR_WS_IMAGES . 'infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
  } else {
	$right_arrow = '';
  }
  if ($right_corner == true) {
	$right_corner = $right_arrow . tep_image(DIR_WS_IMAGES . 'infobox/corner_right.gif');
  } else {
	$right_corner = $right_arrow . tep_draw_separator('pixel_trans.gif', '11', '14');
  }

  $info_box_contents = array();
  $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"',
									 'text' => $left_corner),
							   array('params' => 'width="100%" height="14" class="infoBoxHeading"',
									 'text' => $contents[0]['text']),
							   array('params' => 'height="14" class="infoBoxHeading" nowrap',
									 'text' => $right_corner));
  	  /* drop shadow mod */
  $this->table_parameters = 'class="infoBoxHeading"';
  /* end drop shadow mod */

  $this->tableBox($info_box_contents, true);
}
 }

 class contentBox extends tableBox {
function contentBox($contents) {
  $info_box_contents = array();
  $info_box_contents[] = array('text' => $this->contentBoxContents($contents));
  $this->table_cellpadding = '0'; /* drop shadow mod necessary to change cellpading in contentbox to 0 from 1 */
  $this->table_parameters = 'class="infoBox"';
  $this->tableBox($info_box_contents, true);
}

function contentBoxContents($contents) {
  $this->table_cellpadding = '4';
  $this->table_parameters = 'class="infoBoxContents"';
  return $this->tableBox($contents);
}
 }

 class contentBoxHeading extends tableBox {
function contentBoxHeading($contents) {
  $this->table_width = '100%';
  $this->table_cellpadding = '0';

  $info_box_contents = array();
  $info_box_contents[] = array(array('params' => 'height="14" class="infoBoxHeading"',
									 'text' => tep_image(DIR_WS_IMAGES . 'infobox/corner_left.gif')),
							   array('params' => 'height="14" class="infoBoxHeading" width="100%"',
									 'text' => $contents[0]['text']),
							   array('params' => 'height="14" class="infoBoxHeading"',
									 'text' => tep_image(DIR_WS_IMAGES . 'infobox/corner_right_left.gif')));
  /* drop shadow mod */
  $this->table_parameters = 'class="infoBoxHeading"';
  /* end drop shadow mod */

  $this->tableBox($info_box_contents, true);
}
 }

 class errorBox extends tableBox {
function errorBox($contents) {
  $this->table_data_parameters = 'class="errorBox"';
  $this->tableBox($contents, true);
}
 }

 class productListingBox extends tableBox {
function productListingBox($contents) {
  $this->table_parameters = 'class="productListing"';
  $this->tableBox($contents, true);
}
 }
?>

Link to comment
Share on other sites

Fixed.

 

Change last line of this:

//***********start best seller contribution************************//
class infoBox5 extends tableBox {
function infoBox5($contents) {
  $info_box_contents = array();
  $info_box_contents[] = array('text' => '<marquee id="marquee1" onMouseOver="marquee1.stop();" onMouseOut="marquee1.start()" bgcolor="#FFFFFF" direction="up" scrollAmount="1" style="height:100">' . $this->infoBoxContents($contents) . '</marquee>');
  $this->table_cellpadding = '1';

to

	  $this->table_cellpadding = '0';

Link to comment
Share on other sites

  • 2 months later...

Hi everyone,

 

Just thought I'd pass this on.

 

I didn't need the expiry function of this mod, I just wanted to be able to choose the products in the best seller box and display the image.

 

This is what I did:

 

I ran the sql file, installed the admin side (didn't bother removing the expiry info)

 

Then updated my regular best sellers infobox like so:

 

In catalog/includes/boxes/best_sellers.php, Line 13-17

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);
 }

I changed to this:

if (isset($current_category_id) && ($current_category_id > 0)) {
$best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name, p.products_image from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, ". TABLE_BESTSELLER . " b where p.products_status = '1' and b.products_id = p.products_id and b.products_id = pd.products_id 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, p.products_image from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, ". TABLE_BESTSELLER . " b where p.products_status = '1' and b.products_id = p.products_id and b.products_id = pd.products_id 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);
 }

 

Then same file, at line 34

$bestsellers_list .= '<tr><td class="infoBoxContents" valign="top">' . tep_row_number_format($rows) . '.</td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']) . '">' . $best_sellers['products_name'] . '</a></td></tr>';

 

I changed to:

$bestsellers_list .= '<tr><td class="infoBoxContents" align="center" style="padding-bottom: .5em;"><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).'<br>'. $best_sellers['products_name'] . '</a></td></tr>';

 

And that was it! No need to upload all the catalog files if you have no need for expiry.

 

Sheri

Link to comment
Share on other sites

  • 1 month later...

Please I need some help here!

I'm sure it's a simple thing to fix... but I've been trying for a while and can't find a solution. I followed the instructions the admin works and all but in the catalog I get this error message:

 

 

Warning: require(STS_RESTART_CAPTURE) [function.require]: failed to open stream: No such file or directory in /usr/home/mysite/includes/column_right.php on line 59

 

Fatal error: require() [function.require]: Failed opening required 'STS_RESTART_CAPTURE' (include_path='.:') in /usr/home/mysite/includes/column_right.php on line 59

 

Also in the Step 10 from the instructions says insert this in /catalog/includes/sts_user_code.php:

//Best Sellers Box

$sts_block_name = 'best_sellers2';

require(STS_START_CAPTURE);

include(DIR_WS_BOXES . 'best-sellers2.php');

require(STS_STOP_CAPTURE);

$template['best-sellers2'] = strip_unwanted_tags($sts_block['best-sellers2'], 'best-sellers2');

 

I noticed I have that file under /catalog/includes/modules/sts_inc/sts_user_code.php where I inserted... could that be the problem?

With all the rest I followed the instructions.

Link to comment
Share on other sites

Please I need some help here!

I'm still in need of some help...

I have replaced the text in my sts_user_code.php:

$sts_block_name = 'best_sellers2';
require(STS_START_CAPTURE);
include(DIR_WS_BOXES . 'best-sellers2.php');
require(STS_STOP_CAPTURE);
$template['best-sellers2'] = strip_unwanted_tags($sts_block['best-sellers2'], 'best-sellers2');

with this as if I was just creating a new infobox:

  $sts->start_capture();
  require(DIR_WS_BOXES . 'best-sellers2.php');
  $sts->stop_capture('best-sellers2', 'box');

now the warning error message dissapeared, I can see the site but yet no best sellers are shown.

Link to comment
Share on other sites

I'm still in need of some help...

I have replaced the text in my sts_user_code.php:

$sts_block_name = 'best_sellers2';
require(STS_START_CAPTURE);
include(DIR_WS_BOXES . 'best-sellers2.php');
require(STS_STOP_CAPTURE);
$template['best-sellers2'] = strip_unwanted_tags($sts_block['best-sellers2'], 'best-sellers2');

with this as if I was just creating a new infobox:

  $sts->start_capture();
  require(DIR_WS_BOXES . 'best-sellers2.php');
  $sts->stop_capture('best-sellers2', 'box');

now the warning error message dissapeared, I can see the site but yet no best sellers are shown.

Getting near but not yet...

I can see the bestsellers but only on a PC with IE, not with any other browser or Mac.

What can I do to make it compatible with different browsers/platforms?

Link to comment
Share on other sites

Getting near but not yet...

I can see the bestsellers but only on a PC with IE, not with any other browser or Mac.

What can I do to make it compatible with different browsers/platforms?

 

I couldn't get anywhere yet.

I'm still trying to find a way to make it compatible with different browsers/platforms.

Also if anyone knows how to change the initial background... it looks a bit odd when the box has a different colour background. It starts scrolling from white then when the first best seller appears the colour of the backgrounf box changes too... Is there a way to change the white colour from the beginning?

Any help on the above would be appreciated.

Link to comment
Share on other sites

I couldn't get anywhere yet.

I'm still trying to find a way to make it compatible with different browsers/platforms.

Also if anyone knows how to change the initial background... it looks a bit odd when the box has a different colour background. It starts scrolling from white then when the first best seller appears the colour of the backgrounf box changes too... Is there a way to change the white colour from the beginning?

Any help on the above would be appreciated.

Right, I gave up on IE for Mac. What I have now is a normal list of the best sellers (no scrolling images)showing in all browsers except in Explorer for PC, and Opera which show nothing at all.

This is really driving me mad... so any suggestions are welcome.

Link to comment
Share on other sites

I getting this wierd error on my main page:

 

1054 - Unknown column 'pd.products_id' in 'on clause'

select distinct p.products_id, p.products_image, pd.products_name, p.products_price, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price from products_description pd, products p left join specials s on p.products_id = s.products_id left join bestseller b on p.products_id = b.products_id and p.products_id = pd.products_id where p.products_status = '1' and b.status = '1' order by rand(22069) DESC limit 6

[TEP STOP]

 

 

This got something to do with the database I think? Here is what I got in my bestsellers2.php file:

 

$bestseller_products_query = tep_db_query("select distinct p.products_id, p.products_image, pd.products_name, p.products_price, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_BESTSELLER . " b on p.products_id = b.products_id  and p.products_id = pd.products_id where p.products_status = '1' and b.status = '1' order by rand($mtm) DESC limit " . MAX_DISPLAY_BESTSELLER_PRODUCTS);
	 }

Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...

Ok, so I guess i'm the only that cant get this working...

 

I've installed the contrib, twice in fact. I'm using sts and have installed version for sts but can't get anything to show in the colum. Am I using the right contrib, and should i be adding any bug fixes etc???

 

The admin section allows me to selecte the products, but the only thing the seems to show is the old best sellers box!

 

please hewlp, i must be doing something wrong!! :'(

Link to comment
Share on other sites

  • 3 months later...

Now I installed newest version.... everything fine in admin, can select if the boxes should be shown or not... but on the page I have following mistake:

 

1054 - Unknown column 'pd.products_id' in 'on clause'

select distinct p.products_id, p.products_image, pd.products_name, p.products_price, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price from products_description pd, products p left join specials s on p.products_id = s.products_id left join bestseller b on p.products_id = b.products_id and p.products_id = pd.products_id where p.products_status = '1' and b.status = '1' order by rand(756549525) DESC limit 6

[TEP STOP]

 

 

somebody knows why it works in admin but not on the page?

Link to comment
Share on other sites

For all people that had problems with showing the constribution on the main page and no problems with showing them on the admin, I wrote an update for the constribution:

 

the problem was, that the left join command in mySQL 5++ is parsed not like in 4 or lower...

so all people with mysql version 5+++ couldn't use this constribution...

I solved it with simply adding some brackets:

Update is available here:

 

http://www.oscommerce.com/community/contributions,1944

Link to comment
Share on other sites

  • 4 weeks later...

Hi,

 

Can anybody tell me how to stop the marqee in the best seller box so I can just display the product like a special?

 

Thanks

Mike

 

For all people that had problems with showing the constribution on the main page and no problems with showing them on the admin, I wrote an update for the constribution:

 

the problem was, that the left join command in mySQL 5++ is parsed not like in 4 or lower...

so all people with mysql version 5+++ couldn't use this constribution...

I solved it with simply adding some brackets:

Update is available here:

 

http://www.oscommerce.com/community/contributions,1944

Link to comment
Share on other sites

hey,

look for includes/classes/boxes.php and search this line:

 

$info_box_contents[] = array('text' => '<marquee id="marquee1" onMouseOver="marquee1.stop();" onMouseOut="marquee1.start()" bgcolor="#006300" direction="up" scrollAmount="1" style="height:130">' . $this->infoBoxContents($contents) . '</marquee>');

 

there change scrollAmount="1" to 0 or delete all the marquee part....

 

so you change it so:

$info_box_contents[] = array('text' => '' . $this->infoBoxContents($contents) . '');

 

mail back if it works ok?

Link to comment
Share on other sites

  • 7 months later...

Hi,

 

I have a problem showing category ID corresponding the product.

 

My initial oscommerce bestseler query looks like this:

  $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p2c.products_id = p.products_id and 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);

 

and the bestseller with admin query is:

	$bestseller_products_query = tep_db_query("select distinct p.products_id, p.products_image, pd.products_name, p.products_price, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_BESTSELLER . " b on p.products_id = b.products_id  and p.products_id = pd.products_id where p.products_status = '1' and b.status = '1' order by rand($mtm) DESC limit " . MAX_DISPLAY_BESTSELLER_PRODUCTS);

 

I need get the category ID into the query, but I really don't know how.

If anyone can help...

 

My bestseller list includes product name and link to it, and below category name and link to the category.

 

Thanks! :blink:

Link to comment
Share on other sites

  • 5 months later...

Does this or any contribution allow for parameters be set? Such as only displaying the bestsellers from the past three months or just the best sellers from a specific category or categories? I could not find anything in the forums or contributions.

Samuel Mateo, Jr.

osC 2.2 MS2

Installed Mods:

WYSIWYG HTMLArea 1.7 | Basic Template System 1.0 | osC-Affiliate | OSC-SupportTicket

Featured Products 1.3 | LoginBox 5.2 | LatestNews 1.1.3 | Extras for IE

Link to comment
Share on other sites

  • 2 months later...
  • 4 weeks later...

Hi I think I have successfully installed this Enhanced Bestseller box with admin addons, I set it true in admin and also set more than 6 products to be bestsellers, but on the front webpage I can't see any best sellers there, where could be the problem ? is there anything else need i do before showing up the bestsellers box in front webpage, thanks!

 

Tom

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...